From fc016a129af6d2b705ae130ded4a0d1ad3434a2e Mon Sep 17 00:00:00 2001 From: pk Date: Fri, 3 Jun 1994 15:02:21 +0000 Subject: [PATCH] Fix last bug correctly --- lib/libc/net/res_query.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/net/res_query.c b/lib/libc/net/res_query.c index 87ab9bf13fab..8ed16121f8dc 100644 --- a/lib/libc/net/res_query.c +++ b/lib/libc/net/res_query.c @@ -33,7 +33,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)res_query.c 5.11 (Berkeley) 3/6/91";*/ -static char *rcsid = "$Id: res_query.c,v 1.5 1994/06/01 19:54:07 pk Exp $"; +static char *rcsid = "$Id: res_query.c,v 1.6 1994/06/03 15:02:21 pk Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -287,13 +287,13 @@ res_querydomain(name, domain, class, type, answer, anslen) printf(";; res_querydomain(%s, %s, %d, %d)\n", name, domain, class, type); #endif - if (domain == NULL && *name != '\0') { + if (domain == NULL) { /* * Check for trailing '.'; * copy without '.' if present. */ n = strlen(name) - 1; - if (name[n] == '.' && n < sizeof(nbuf) - 1) { + if (n != (0 - 1) && name[n] == '.' && n < sizeof(nbuf) - 1) { bcopy(name, nbuf, n); nbuf[n] = '\0'; } else