From: Nick Mathewson Date: Wed, 26 Nov 2008 16:13:12 +0000 (+0000) Subject: Cast uid_t and gid_t to unsigned before passing to printf %u. X-Git-Tag: tor-0.2.1.8-alpha~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4cddcf887362d3a5c8f938694ba413f08ee6311c;p=thirdparty%2Ftor.git Cast uid_t and gid_t to unsigned before passing to printf %u. svn:r17392 --- 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 */