summaryrefslogtreecommitdiffstats
path: root/usr.bin/whois
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2001-07-22 18:23:24 +0000
committermike <mike@FreeBSD.org>2001-07-22 18:23:24 +0000
commitf322ed687376f4ac00e13420d79a8eade13c0189 (patch)
tree4d2a59b4d1b5c1ad31608ee863e5848055465436 /usr.bin/whois
parent0fa6b005d6fc26722f2049c934f3c41b2a1395e7 (diff)
downloadFreeBSD-src-f322ed687376f4ac00e13420d79a8eade13c0189.zip
FreeBSD-src-f322ed687376f4ac00e13420d79a8eade13c0189.tar.gz
Fix a bug I introduced in Rev. 1.21 that prevented 'whois test' from
working. Reviewed by: des Approved by: des
Diffstat (limited to 'usr.bin/whois')
-rw-r--r--usr.bin/whois/whois.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index 6fd7e1c..4115f44 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -193,6 +193,8 @@ choose_server(char *domain)
errx(EX_USAGE, "can't search for a null string");
while (pos > domain && *pos != '.')
--pos;
+ if (pos <= domain)
+ return (NULL);
if (isdigit((unsigned char)*++pos))
s_asprintf(&retval, "%s", ANICHOST);
else
OpenPOWER on IntegriCloud