Puoi eliminare gli spazi iniziali con qualcosa del tipo
codice:
int k = strspn(str, " \t");
memmove(str, str+k, strlen(str+k)+1);