From 6442d8b7fbc2c5627c4d2b2e1913c6cd0b075df9 Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 14 Apr 1997 07:01:42 +0000 Subject: [PATCH] i was not the brightest here either --- usr.sbin/rwhod/rwhod.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index 09ed5401b52..fab0144e5aa 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -39,7 +39,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "@(#)rwhod.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: rwhod.c,v 1.8 1997/04/13 01:53:49 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: rwhod.c,v 1.9 1997/04/14 07:01:42 deraadt Exp $"; #endif /* not lint */ #include @@ -257,13 +257,15 @@ verify(p) if (*p == '.' || *p == '-') return 0; while ((c = *p++)) { - if (('a' <= c && c >= 'z') || - ('A' <= c && c >= 'Z') || - ('0' <= c && c >= '9')) + if (('a' <= c && c <= 'z') || + ('A' <= c && c <= 'Z') || + ('0' <= c && c <= '9')) continue; - if (strchr("-_/[]\\", c) || - (c == '.' && *p == '.')) + if (c == '.' && *p == '.') return 0; + if (c == '.' || c == '-') + continue; + return 0; } return 1; } -- 2.20.1