summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2017-11-29 01:25:12 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2017-11-29 01:25:12 +0000
commit32bc8e9194ee23b818c812249fb05cb47f195254 (patch)
tree35ccbfdd825aa527dd52a3bf22c0753ea7e2a1d7 /sbin
parent262706d19fa39da95f7446ba679ee9e35567c15b (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.c6
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) {