# HG changeset patch # User Sadrul Habib Chowdhury # Date 1231271418 0 # Node ID cead8692e35f8ec060a7326914551b8cce0671ce # Parent 253e5d3988ca3c200864972ee58d11a896ae5018 Terminate the loop on the first null-character. (Currently it would not terminate for the first null in, e.g. "1 2 \0 3") diff -r 253e5d3988ca -r cead8692e35f libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Tue Jan 06 16:19:16 2009 +0000 +++ b/libpurple/protocols/myspace/myspace.c Tue Jan 06 19:50:18 2009 +0000 @@ -2876,10 +2876,9 @@ } /* Strip spaces. */ - for (i=0, j=0; normalized[j]; i++, j++) { - while (normalized[j] == ' ') - j++; - normalized[i] = normalized[j]; + for (i=0, j=0; normalized[j]; j++) { + if (normalized[j] != ' ') + normalized[i++] = normalized[j]; } normalized[i] = '\0';