mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
chroot,whoami: use uintmax_t for printing uids
* src/chroot.c (main): Cast the uid to uintmax_t instead of int. * src/whoami.c (main): Cast the uid to uintmax_t instead of unsigned long int.
This commit is contained in:
1 parent
0911361e79
commit
8083944484
2 files changed
+4
-3
No files matched your search
+2
-1
@@ -375,7 +375,8 @@ main (int argc, char **argv)
|
||||
else if (gid_unset (gid))
|
||||
{
|
||||
error (EXIT_CANCELED, errno,
|
||||
_("no group specified for unknown uid: %d"), (int) uid);
|
||||
_("no group specified for unknown uid: %ju"),
|
||||
(uintmax_t) uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -81,8 +81,8 @@ main (int argc, char **argv)
|
||||
uid = geteuid ();
|
||||
pw = uid == NO_UID && errno ? nullptr : getpwuid (uid);
|
||||
if (!pw)
|
||||
error (EXIT_FAILURE, errno, _("cannot find name for user ID %lu"),
|
||||
(unsigned long int) uid);
|
||||
error (EXIT_FAILURE, errno, _("cannot find name for user ID %ju"),
|
||||
(uintmax_t) uid);
|
||||
puts (pw->pw_name);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in new issue
Block a user