diff --git a/doc/Changelog b/doc/Changelog index b4c2b87..a8be14e 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,8 @@ sysvinit (2.89) UNRELEASED; urgency=low [ Jesse Smith ] + * Fixed Clang compiler warning regarding variable data parameters to sprintf(). + * Updated top-level Makefile to work with git repo instead of old svn repo. * Removed unused variables and findtty() function in bootlogd * Add checks to return code for fscanf() called in init.c. This mostly just cleans up compiler warnings. diff --git a/src/dowall.c b/src/dowall.c index 85645c0..8f4c614 100644 --- a/src/dowall.c +++ b/src/dowall.c @@ -96,7 +96,14 @@ static void getuidtty(char **userp, char **ttyp) uidbuf[0] = 0; strncat(uidbuf, pwd->pw_name, sizeof(uidbuf) - 1); } else { + /* Using variable number of data parameters in one + function makes the Clang compiler cry. -- Jesse sprintf(uidbuf, uid ? "uid %d" : "root", (int)uid); + */ + if (uid) + sprintf(uidbuf, "uid %d", (int) uid); + else + sprintf(uidbuf, "root"); } if ((tty = ttyname(0)) != NULL) {