diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2017-11-29 01:25:12 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2017-11-29 01:25:12 +0000 |
commit | 32bc8e9194ee23b818c812249fb05cb47f195254 (patch) | |
tree | 35ccbfdd825aa527dd52a3bf22c0753ea7e2a1d7 /sbin | |
parent | 262706d19fa39da95f7446ba679ee9e35567c15b (diff) |
Print_host is used mainly in printf style functions. So do not return NULL
instead return "unknown".
OK beck@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/iked/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/iked/util.c b/sbin/iked/util.c index 5f232a314b7..1d4cee2c424 100644 --- a/sbin/iked/util.c +++ b/sbin/iked/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.33 2017/01/09 14:49:21 reyk Exp $ */ +/* $OpenBSD: util.c,v 1.34 2017/11/29 01:25:11 claudio Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> @@ -654,8 +654,8 @@ print_host(struct sockaddr *sa, char *buf, size_t len) if (getnameinfo(sa, sa->sa_len, buf, len, NULL, 0, NI_NUMERICHOST) != 0) { - buf[0] = '\0'; - return (NULL); + strlcpy(buf, "unknown", len); + return (buf); } if ((port = socket_getport(sa)) != 0) { |