"Rolf" == Rolf Kalbermatter rolf.kalbermatter@citeng.com writes:
Rolf> Uwe Bonnes wrote: >> The test for nLen is a good idea. But with nLen = >> strlen(lpwhr->lpszPath); lpwhr->lpszPath[nLen] should give the >> terminating NULL to my understanding... >> >> Or am I off by one?
char test[]="a" strlen(test) = 1; test[strlen(test)-1] = 'a' test[0] = 'a' test[strlen(test)] = '\0'
char test1[]="a\n" strlen(test1) = 2; test1[strlen(test)-1] = '\n'
In this case, my patch overwrites test1[strlen(test)-1] with '\0'
This is what I intend.