> Out of curiosity, what value are you passing to malloc()?
>
Of course, I forgot:
temp = malloc((i + 1) * (sizeof(char)));
It allocates memory for a token out of a whitespace-separated string.
/Andreas