diff options
author | kan <kan@FreeBSD.org> | 2003-07-11 05:47:05 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2003-07-11 05:47:05 +0000 |
commit | 8c2df19687b187984be9a4b27caba6d4bcf1b96b (patch) | |
tree | 84931f6828f4b8ccd41393c4be85ba28f8e3c42a /usr.bin/chpass | |
parent | e16ef3051fc93762c9e35dc8623f838d928e1d07 (diff) | |
download | FreeBSD-src-8c2df19687b187984be9a4b27caba6d4bcf1b96b.zip FreeBSD-src-8c2df19687b187984be9a4b27caba6d4bcf1b96b.tar.gz |
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 'usr.bin/chpass')
-rw-r--r-- | usr.bin/chpass/field.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/chpass/field.c b/usr.bin/chpass/field.c index ffa79fa..fe5b30f 100644 --- a/usr.bin/chpass/field.c +++ b/usr.bin/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); } |