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:
Robert Love
2006-02-06 17:12:04 +00:00
committed by Robert Love
parent f8847439ae
commit dc0ce48841
2 changed files with 10 additions and 2 deletions

View File

@@ -1,3 +1,10 @@
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.
2006-02-05 Dan Williams <dcbw@redhat.com>
Refine handling of non-broadcast networks.
@@ -33,7 +40,7 @@
2006-02-05 Robert Love <rml@novell.com>
Patch by Christoph Brill <chrisbrill@gmx.net>
Patch by Christoph Brill <chrisbrill@gmx.net>:
* src/dhcp-manager/nm-dhcp-manager.c: Replace two open coded defines
with DHCP_SERVICE_NAME.

View File

@@ -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;