Skip to content

Commit

Permalink
Disable isxdigit block until proper solution will be found
Browse files Browse the repository at this point in the history
isxdigit(name[0]) gives false failures on short names which looks
like hexadecimal digits, f.e. "fade", "babe", "d133", etc.
  • Loading branch information
Andrey A. Chernov authored and Andrey A. Chernov committed Jan 5, 1997
1 parent 42446c5 commit 64cf8d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/libc/net/gethostbydns.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.20 1996/09/28 06:51:07 vixie Exp";
static char rcsid[] = "$Id: gethostbydns.c,v 1.15 1996/12/27 18:21:05 wpaul Exp $";
static char rcsid[] = "$Id: gethostbydns.c,v 1.16 1996/12/30 13:18:37 peter Exp $";
#endif /* LIBC_SCCS and not lint */

#include <sys/types.h>
Expand Down Expand Up @@ -497,6 +497,11 @@ _gethostbydnsname(name, af)
if (!isdigit(*cp) && *cp != '.')
break;
}
/*
* XXX: isxdigit(name[0]) gives false failures on short names which looks
* like hexadecimal digits, f.e. "fade", "babe", "d133", etc.
*/
#if 0
if (isxdigit(name[0]) || name[0] == ':')
for (cp = name;; ++cp) {
if (!*cp) {
Expand Down Expand Up @@ -527,7 +532,7 @@ _gethostbydnsname(name, af)
if (!isxdigit(*cp) && *cp != ':' && *cp != '.')
break;
}

#endif /* XXX */
if ((n = res_search(name, C_IN, type, buf.buf, sizeof(buf))) < 0) {
dprintf("res_search failed (%d)\n", n);
return (NULL);
Expand Down

0 comments on commit 64cf8d6

Please sign in to comment.