=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/whois/whois.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- src/usr.bin/whois/whois.c 2003/01/07 17:24:08 1.22 +++ src/usr.bin/whois/whois.c 2003/01/15 23:16:29 1.23 @@ -1,4 +1,4 @@ -/* $OpenBSD: whois.c,v 1.22 2003/01/07 17:24:08 millert Exp $ */ +/* $OpenBSD: whois.c,v 1.23 2003/01/15 23:16:29 millert Exp $ */ /* * Copyright (c) 1980, 1993 @@ -43,7 +43,7 @@ #if 0 static const char sccsid[] = "@(#)whois.c 8.1 (Berkeley) 6/6/93"; #else -static const char rcsid[] = "$OpenBSD: whois.c,v 1.22 2003/01/07 17:24:08 millert Exp $"; +static const char rcsid[] = "$OpenBSD: whois.c,v 1.23 2003/01/15 23:16:29 millert Exp $"; #endif #endif /* not lint */ @@ -101,7 +101,7 @@ country = host = server = NULL; flags = rval = 0; while ((ch = getopt(argc, argv, "aAc:dgh:ilmp:qQrR6")) != -1) - switch((char)ch) { + switch(ch) { case 'a': host = ANICHOST; break; @@ -246,6 +246,8 @@ for (i = 0; ip_whois[i] != NULL; i++) { if (strstr(buf, ip_whois[i]) != NULL) { nhost = strdup(ip_whois[i]); + if (nhost == NULL) + err(1, "strdup"); break; } } @@ -304,7 +306,7 @@ extern char *__progname; (void)fprintf(stderr, - "usage: %s [-aAdgilmpQrR6] [-c country-code | -h hostname] " + "usage: %s [-aAdgilmQrR6] [-c country-code | -h hostname] " "[-p port] name ...\n", __progname); exit(1); }