1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 18:56:39 +02:00

(skip): Add casts to avoid warning about comparison

between signed and unsigned. Also rearrange range-checking
comparisons to make them more readable.
This commit is contained in:
Jim Meyering
2002-09-02 07:38:53 +00:00
parent 2ebfe2fc9c
commit 0ea01d21a3

View File

@@ -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;
}