Roberto Waltman wrote:
>
> void aaalib_trim (char *in) {
> int n = strlen(in) - 1;
> for ( ; n>= 0; n--)
> if (!isspace(in[n]))
> break;
> in[n+1] = '\0';
> }
>
> strlen(in) is always greater than 1, right? 
>
strlen can be zero. Then, strlen(in)-1 is -1.
Since he tests for n>=0 the loop never gets
executed.
Then, in[n+1] == in[0] == 0 anyway since
strlen gave zero, so he overwrites a zero with a zero,
a harmless operation
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32