From 2d1b974f3a71544c2aa9e4e648a3acad80ed7aaa Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sat, 1 Aug 2015 09:55:47 +0000 Subject: Cast uid/git to uintmax_t when using printf-like functions so the size of uid/gid size remains a implementation detail --- pw/pw_group.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pw/pw_group.c') 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 #include +#include #include #include #include @@ -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; -- cgit v1.2.3-56-ge451