2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Fix compilation on gcc 2.95 and other compilers that only allow

variable declarations at the beginning of a block.
This commit is contained in:
Todd C. Miller
2012-06-18 13:47:01 -04:00
parent fdcc8e1fce
commit 45fea137f9
2 changed files with 5 additions and 2 deletions

View File

@@ -130,10 +130,12 @@ do_syslog(int pri, char *msg)
size_t len, maxlen;
char *p, *tmp, save;
const char *fmt;
#ifdef HAVE_SETLOCALE
const char *old_locale = estrdup(setlocale(LC_ALL, NULL));
#endif
debug_decl(do_syslog, SUDO_DEBUG_LOGGING)
#ifdef HAVE_SETLOCALE
const char *old_locale = estrdup(setlocale(LC_ALL, NULL));
if (!setlocale(LC_ALL, def_sudoers_locale))
setlocale(LC_ALL, "C");
#endif /* HAVE_SETLOCALE */