diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 06c9d727730d..96b0a2b45c65 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -323,7 +323,7 @@ main(argc, argv) } p = hp->h_name; } - if (nflag && inet_addr(p) == INADDR_NONE) { + if (nflag && strcmp(p, "-") && inet_addr(p) == INADDR_NONE) { hp = gethostbyname(p); if (hp != NULL) {