From: Todd C. Miller Date: Thu, 13 Mar 2003 16:58:25 +0000 (+0000) Subject: snprintf() a uid as %lu, not %ld to match the MAX_UID_T_LEN test in X-Git-Tag: SUDO_1_6_7~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96376b6d4e594f37a8a29bc759bc3cb189189b9e;p=sudo snprintf() a uid as %lu, not %ld to match the MAX_UID_T_LEN test in configure. --- diff --git a/sudo.c b/sudo.c index c7bc23dd7..5081845ed 100644 --- a/sudo.c +++ b/sudo.c @@ -525,7 +525,8 @@ init_vars(sudo_mode) char pw_name[MAX_UID_T_LEN + 1]; pw.pw_uid = getuid(); - (void) snprintf(pw_name, sizeof(pw_name), "%ld", (long) pw.pw_uid); + (void) snprintf(pw_name, sizeof(pw_name), "%lu", + (unsigned long) pw.pw_uid); pw.pw_name = pw_name; sudo_user.pw = &pw;