summaryrefslogtreecommitdiff
path: root/openbsd-compat/pwcache.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2019-07-06 13:02:34 +1000
committerDarren Tucker <dtucker@dtucker.net>2019-07-06 13:02:34 +1000
commit4c3e00b1ed7e596610f34590eb5d54ee50d77878 (patch)
tree646e12361a847bb01aa1e3da580077a723e9ff5a /openbsd-compat/pwcache.c
parent2753521e899f30d1d58b5da0b4e68fde6fcf341e (diff)
Cast *ID types to unsigned long when printing.
UID and GID types vary by platform so cast to u_long and use %lu when printing them to prevent warnings.
Diffstat (limited to 'openbsd-compat/pwcache.c')
-rw-r--r--openbsd-compat/pwcache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsd-compat/pwcache.c b/openbsd-compat/pwcache.c
index 5a8b78801..826c2378b 100644
--- a/openbsd-compat/pwcache.c
+++ b/openbsd-compat/pwcache.c
@@ -67,7 +67,7 @@ user_from_uid(uid_t uid, int nouser)
67 if ((pw = getpwuid(uid)) == NULL) { 67 if ((pw = getpwuid(uid)) == NULL) {
68 if (nouser) 68 if (nouser)
69 return (NULL); 69 return (NULL);
70 (void)snprintf(nbuf, sizeof(nbuf), "%u", uid); 70 (void)snprintf(nbuf, sizeof(nbuf), "%lu", (u_long)uid);
71 } 71 }
72 cp->uid = uid; 72 cp->uid = uid;
73 if (cp->name != NULL) 73 if (cp->name != NULL)
@@ -102,7 +102,7 @@ group_from_gid(gid_t gid, int nogroup)
102 if ((gr = getgrgid(gid)) == NULL) { 102 if ((gr = getgrgid(gid)) == NULL) {
103 if (nogroup) 103 if (nogroup)
104 return (NULL); 104 return (NULL);
105 (void)snprintf(nbuf, sizeof(nbuf), "%u", gid); 105 (void)snprintf(nbuf, sizeof(nbuf), "%lu", (u_long)gid);
106 } 106 }
107 cp->gid = gid; 107 cp->gid = gid;
108 if (cp->name != NULL) 108 if (cp->name != NULL)