summaryrefslogtreecommitdiffstats
path: root/chpass
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2003-07-11 05:47:05 +0000
committerAlexander Kabaev <kan@FreeBSD.org>2003-07-11 05:47:05 +0000
commit08d5df2c9008818453550568b47ee19a90c1f8c8 (patch)
tree0842b335e2819644474cf85540ff441f2a106a7a /chpass
parent46236fc24b3cf4b8f20298f1859163b9908d6a2a (diff)
downloadpw-darwin-08d5df2c9008818453550568b47ee19a90c1f8c8.tar.gz
pw-darwin-08d5df2c9008818453550568b47ee19a90c1f8c8.tar.zst
pw-darwin-08d5df2c9008818453550568b47ee19a90c1f8c8.zip
Do not compare unsigned int values with ULONG_MAX. The comparison is
always false on 64bit platforms and GCC 3.3.1 issues warning there.
Diffstat (limited to 'chpass')
-rw-r--r--chpass/field.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/chpass/field.c b/chpass/field.c
index ffa79fa..fe5b30f 100644
--- a/chpass/field.c
+++ b/chpass/field.c
@@ -118,7 +118,7 @@ p_uid(char *p, struct passwd *pw, ENTRY *ep __unused)
}
errno = 0;
id = strtoul(p, &np, 10);
- if (*np || (id == ULONG_MAX && errno == ERANGE)) {
+ if (*np || (id == (uid_t)ULONG_MAX && errno == ERANGE)) {
warnx("illegal uid");
return (-1);
}
@@ -148,7 +148,7 @@ p_gid(char *p, struct passwd *pw, ENTRY *ep __unused)
}
errno = 0;
id = strtoul(p, &np, 10);
- if (*np || (id == ULONG_MAX && errno == ERANGE)) {
+ if (*np || (id == (uid_t)ULONG_MAX && errno == ERANGE)) {
warnx("illegal gid");
return (-1);
}