diff options
author | 2018-03-20 11:46:32 +0000 | |
---|---|---|
committer | 2018-03-20 11:46:32 +0000 | |
commit | 47710c91cc682ceda611e4be6600046dee5a277a (patch) | |
tree | 35cb69f64b8efed738b9e1b3a9c4f504ad55ee48 | |
parent | Call bpfdetach() without holding the NET_LOCK(). (diff) | |
download | wireguard-openbsd-47710c91cc682ceda611e4be6600046dee5a277a.tar.xz wireguard-openbsd-47710c91cc682ceda611e4be6600046dee5a277a.zip |
pretty_print_option() returns a pointer to a 0 length string, not
NULL, on failure.
Eliminates possible "option = ;' lines in lease files.
-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); |