From 2c69b9a13e3209034c5e4d8d7b576edb1deecefc Mon Sep 17 00:00:00 2001 From: Mike Barcroft Date: Sun, 22 Jul 2001 18:23:24 +0000 Subject: [PATCH] Fix a bug I introduced in Rev. 1.21 that prevented 'whois test' from working. Reviewed by: des Approved by: des --- usr.bin/whois/whois.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c index 6fd7e1cb8ed..4115f4434e6 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