From 5164bf87729f7c24f406c652595edf0bdfa3b548 Mon Sep 17 00:00:00 2001 From: mrg Date: Sat, 26 Apr 1997 04:12:08 +0000 Subject: [PATCH] handle hex hostnames (from vixie, as reported in PR#3535). --- lib/libc/net/gethostnamadr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index cbbe6f447842..c2c48617c511 100644 --- a/lib/libc/net/gethostnamadr.c +++ b/lib/libc/net/gethostnamadr.c @@ -1,4 +1,4 @@ -/* $NetBSD: gethostnamadr.c,v 1.22 1997/04/14 01:38:26 mrg Exp $ */ +/* $NetBSD: gethostnamadr.c,v 1.23 1997/04/26 04:12:08 mrg Exp $ */ /* * ++Copyright++ 1985, 1988, 1993 @@ -60,7 +60,7 @@ static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "Id: gethnamaddr.c,v 8.20 1996/09/28 06:51:07 vixie Exp"; #else -static char rcsid[] = "$NetBSD: gethostnamadr.c,v 1.22 1997/04/14 01:38:26 mrg Exp $"; +static char rcsid[] = "$NetBSD: gethostnamadr.c,v 1.23 1997/04/26 04:12:08 mrg Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -509,7 +509,8 @@ gethostbyname2(name, af) if (!isdigit(*cp) && *cp != '.') break; } - if (isxdigit(name[0]) || name[0] == ':') + if ((isxdigit(name[0]) && strchr(name, ':') != NULL) || + name[0] == ':') for (cp = name;; ++cp) { if (!*cp) { if (*--cp == '.')