diff options
author | Jim Meyering <jim@meyering.net> | 2002-09-02 07:38:53 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-09-02 07:38:53 +0000 |
commit | 0ea01d21a34447f456ce340bad52f4629cb8d73d (patch) | |
tree | e29eec3c62664f8dc5296450e396e67215734c6c | |
parent | 2ebfe2fc9cef268af753488f258a13a31b733f1d (diff) | |
download | coreutils-0ea01d21a34447f456ce340bad52f4629cb8d73d.tar.xz |
(skip): Add casts to avoid warning about comparison
between signed and unsigned. Also rearrange range-checking
comparisons to make them more readable.
-rw-r--r-- | src/install.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/install.c b/src/install.c index 3be52b095..7e0d8ed06 100644 --- a/src/install.c +++ b/src/install.c @@ -560,7 +560,7 @@ get_ids (void) { long int tmp_long; if (xstrtol (owner_name, NULL, 0, &tmp_long, NULL) != LONGINT_OK - || tmp_long < 0 || tmp_long > UID_T_MAX) + || !(0 <= tmp_long && (uid_t) tmp_long <= UID_T_MAX)) error (EXIT_FAILURE, 0, _("invalid user %s"), quote (owner_name)); owner_id = (uid_t) tmp_long; } @@ -578,7 +578,7 @@ get_ids (void) { long int tmp_long; if (xstrtol (group_name, NULL, 0, &tmp_long, NULL) != LONGINT_OK - || tmp_long < 0 || tmp_long > GID_T_MAX) + || !(0 <= tmp_long && (gid_t) tmp_long <= GID_T_MAX)) error (EXIT_FAILURE, 0, _("invalid group %s"), quote (group_name)); group_id = (gid_t) tmp_long; } |