2006-02-06 Robert Love <rml@novell.com>
* src/NetworkManagerUtils.c: kill_newline(): 'l' is unsigned so the test ">=" is never false. If no newline is found, we loop forever. We can just check for ">" because the following if will see zero-th argument if the while gets that far. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1455 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -709,7 +709,8 @@ kill_newline (char *s, size_t *l)
|
||||
{
|
||||
g_return_val_if_fail (l != NULL, s);
|
||||
|
||||
while ((--(*l) >= 0) && (s[*l] != '\n'));
|
||||
while ((--(*l) > 0) && (s[*l] != '\n'))
|
||||
;
|
||||
if (s[*l] == '\n')
|
||||
s[*l] = '\0';
|
||||
return s;
|
||||
|
Reference in New Issue
Block a user