From 60fcc3d0762e31781a37f979e186b2b72646d30a Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Sun, 30 Oct 1988 21:43:42 -0800 Subject: [PATCH] check for h_errno < 0 SCCS-vsn: lib/libc/net/herror.c 6.4 --- usr/src/lib/libc/net/herror.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr/src/lib/libc/net/herror.c b/usr/src/lib/libc/net/herror.c index 1030f499db..615ac629a5 100644 --- a/usr/src/lib/libc/net/herror.c +++ b/usr/src/lib/libc/net/herror.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)herror.c 6.3 (Berkeley) %G%"; +static char sccsid[] = "@(#)herror.c 6.4 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -51,7 +51,8 @@ herror(s) v->iov_len = 2; v++; } - v->iov_base = h_errno < h_nerr ? h_errlist[h_errno] : "Unknown error"; + v->iov_base = (u_int)h_errno < h_nerr ? + h_errlist[h_errno] : "Unknown error"; v->iov_len = strlen(v->iov_base); v++; v->iov_base = "\n"; -- 2.20.1