I am trying to tokenize the user inputed commands for a shell program. The program runs but I don't think that it is filling the param array I have declared. I'm sorry if it seems that I don't have a ton of information as I am learning this as a do it, but I am not sure why it isn't filling param. Any help would be grateful and if you need any additional information please feel free to ask.
#include "HeaderFile.h"
#include <stdio.h>
#include <stdlib.h>
#define token_delimiter " \n\r"
char **shell_read(char *line, char **param){
line = NULL;
ssize_t size = 0;
getline(&line, &size, stdin);
//printf("%s", line);
int i = 0;
char *line_token;
line_token = strtok(line, token_delimiter);
printf("%s", line_token);
for(i=1; line_token!=NULL; i++){
param[i] = line_token;
line_token = strtok(NULL, token_delimiter);
}
param[0] = NULL;
return(param);
}