From 4cddcf887362d3a5c8f938694ba413f08ee6311c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 26 Nov 2008 16:13:12 +0000 Subject: [PATCH] Cast uid_t and gid_t to unsigned before passing to printf %u. svn:r17392 --- src/common/compat.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/common/compat.c b/src/common/compat.c index df1e94b029..31fbf263e4 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -978,7 +978,8 @@ log_credential_status(void) return -1; } else { log_fn(CREDENTIAL_LOG_LEVEL, LD_GENERAL, - "UID is %u (real), %u (effective), %u (saved)", ruid, euid, suid); + "UID is %u (real), %u (effective), %u (saved)", + (unsigned)ruid, (unsigned)euid, (unsigned)suid); } #else /* getresuid is not present on MacOS X, so we can't get the saved (E)UID */ @@ -987,7 +988,8 @@ log_credential_status(void) (void)suid; log_fn(CREDENTIAL_LOG_LEVEL, LD_GENERAL, - "UID is %u (real), %u (effective), unknown (saved)", ruid, euid); + "UID is %u (real), %u (effective), unknown (saved)", + (unsigned)ruid, (unsigned)euid); #endif /* log GIDs */ @@ -997,7 +999,8 @@ log_credential_status(void) return -1; } else { log_fn(CREDENTIAL_LOG_LEVEL, LD_GENERAL, - "GID is %u (real), %u (effective), %u (saved)", rgid, egid, sgid); + "GID is %u (real), %u (effective), %u (saved)", + (unsigned)rgid, (unsigned)egid, (unsigned)sgid); } #else /* getresgid is not present on MacOS X, so we can't get the saved (E)GID */ @@ -1005,7 +1008,8 @@ log_credential_status(void) egid = getegid(); (void)sgid; log_fn(CREDENTIAL_LOG_LEVEL, LD_GENERAL, - "GID is %u (real), %u (effective), unknown (saved)", rgid, egid); + "GID is %u (real), %u (effective), unknown (saved)", + (unsigned)rgid, (unsigned)egid); #endif /* log supplementary groups */ -- 2.47.3