summaryrefslogtreecommitdiffstats
path: root/libc/gen/pw_scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/gen/pw_scan.c')
-rw-r--r--libc/gen/pw_scan.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libc/gen/pw_scan.c b/libc/gen/pw_scan.c
index 5190686..0ce9b1d 100644
--- a/libc/gen/pw_scan.c
+++ b/libc/gen/pw_scan.c
@@ -78,7 +78,12 @@ pw_scan(bp, pw)
if (!(p = strsep(&bp, ":"))) /* uid */
goto fmt;
- if(p[0]) pw->pw_fields |= _PWF_UID;
+ if (p[0])
+ pw->pw_fields |= _PWF_UID;
+ else {
+ warnx("no uid for user %s", pw->pw_name);
+ return (0);
+ }
id = atol(p);
if (root && id) {
warnx("root uid should be 0");