why does this code not fill the tokens array properly
// tokenize line
char *tokens[MAXLINE];
int i = 0;
char *token = strtok(line, " \t\r\n");
tokens[i] = token;
i++;
int num_tokens = 1;

while (token != NULL) {
    token = strtok(NULL, " \t\r\n");
    tokens[i] = token;
    i++;
    num_tokens++;
}
// line is tokenized