skip_to_semi() is gilding the lily when the next statement breaks out
authorkrw <krw@openbsd.org>
Fri, 10 Jan 2014 01:25:03 +0000 (01:25 +0000)
committerkrw <krw@openbsd.org>
Fri, 10 Jan 2014 01:25:03 +0000 (01:25 +0000)
of the loop and closes the file being parsed. And the previous
statement warns the user the leases file being parsed has been
determined to be corrupt. Eliminate further gilding in the form of an
'else' after the same 'if' clause includes the 'break'.

sbin/dhclient/clparse.c

index 5ca5d1a..35c90a4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: clparse.c,v 1.66 2014/01/10 01:07:58 krw Exp $        */
+/*     $OpenBSD: clparse.c,v 1.67 2014/01/10 01:25:03 krw Exp $        */
 
 /* Parser for dhclient config and lease files. */
 
@@ -130,10 +130,9 @@ read_client_leases(void)
                        break;
                if (token != TOK_LEASE) {
                        warning("Corrupt lease file - possible data loss!");
-                       skip_to_semi(cfile);
                        break;
-               } else
-                       parse_client_lease_statement(cfile, 0);
+               }
+               parse_client_lease_statement(cfile, 0);
 
        } while (1);
        fclose(cfile);