diff --git a/ChangeLog b/ChangeLog index 58728be26..b05905638 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-02-06 Robert Love + + * 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 Refine handling of non-broadcast networks. @@ -33,7 +40,7 @@ 2006-02-05 Robert Love - Patch by Christoph Brill + Patch by Christoph Brill : * src/dhcp-manager/nm-dhcp-manager.c: Replace two open coded defines with DHCP_SERVICE_NAME. diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 841a031f4..55860dfd1 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -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;