char** separate_commandline (char *msg, char sep) { unsigned int len; char** two_words; /* Yes, do nothing, just get len ! */ for (len = 0; msg[len] != sep; len++); two_words = malloc (sizeof(char*) * 2); msg[len] = '\0'; two_words[0] = msg; two_words[1] = msg + len + 1; return (two_words); }