diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2018-03-20 11:46:33 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2018-03-20 11:46:33 +0000 |
commit | 0c00cc33257889799cb4a23bef691e1978fd76b3 (patch) | |
tree | 99dad260e9f99fbb5e73763ef7cc6cba5ff8f9c5 /sbin/dhclient | |
parent | 1f9be315e726a23aa52c9fb5cbd2180e10f8eded (diff) |
pretty_print_option() returns a pointer to a 0 length string, not
NULL, on failure.
Eliminates possible "option = ;' lines in lease files.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r-- | sbin/dhclient/dhclient.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index d1beddfc07f..aa2e6036308 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.565 2018/02/28 22:16:56 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.566 2018/03/20 11:46:32 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -1961,8 +1961,8 @@ lease_as_string(char *ifname, char *type, struct client_lease *lease) name = code_to_name(i); buf = pretty_print_option(i, opt, 1); - if (buf == NULL) - return NULL; + if (strlen(buf) == 0) + continue; strlcat(string, " option ", sizeof(string)); strlcat(string, name, sizeof(string)); append_statement(string, sizeof(string), " ", buf); |