diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-08-01 09:55:47 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-08-01 09:55:47 +0000 |
commit | 2d1b974f3a71544c2aa9e4e648a3acad80ed7aaa (patch) | |
tree | b6490e90293ee214eb54f001b25695f4e3833e8d /pw/pw_group.c | |
parent | 118a862383488360f366603cc32994fd65718474 (diff) | |
download | pw-darwin-2d1b974f3a71544c2aa9e4e648a3acad80ed7aaa.tar.gz pw-darwin-2d1b974f3a71544c2aa9e4e648a3acad80ed7aaa.tar.zst pw-darwin-2d1b974f3a71544c2aa9e4e648a3acad80ed7aaa.zip |
Cast uid/git to uintmax_t when using printf-like functions so the size of
uid/gid size remains a implementation detail
Diffstat (limited to 'pw/pw_group.c')
-rw-r--r-- | pw/pw_group.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pw/pw_group.c b/pw/pw_group.c index b0db3cf..3d5e70a 100644 --- a/pw/pw_group.c +++ b/pw/pw_group.c @@ -31,6 +31,7 @@ static const char rcsid[] = #include <ctype.h> #include <err.h> +#include <inttypes.h> #include <termios.h> #include <stdbool.h> #include <unistd.h> @@ -97,7 +98,7 @@ pw_groupnext(struct userconf *cnf, bool quiet) if (quiet) return (next); - printf("%u\n", next); + printf("%ju\n", (uintmax_t)next); return (EXIT_SUCCESS); } @@ -283,7 +284,7 @@ pw_group(int mode, char *name, long id, struct cargs * args) if ((grp = GETGRNAM(name)) == NULL) errx(EX_SOFTWARE, "group disappeared during update"); - pw_log(cnf, mode, W_GROUP, "%s(%u)", grp->gr_name, grp->gr_gid); + pw_log(cnf, mode, W_GROUP, "%s(%ju)", grp->gr_name, (uintmax_t)grp->gr_gid); return EXIT_SUCCESS; } @@ -345,7 +346,7 @@ gr_gidpolicy(struct userconf * cnf, long id) gid = (gid_t) id; if ((grp = GETGRGID(gid)) != NULL && conf.checkduplicate) - errx(EX_DATAERR, "gid `%u' has already been allocated", grp->gr_gid); + errx(EX_DATAERR, "gid `%ju' has already been allocated", (uintmax_t)grp->gr_gid); } else { struct bitmap bm; |