]> granicus.if.org Git - sudo/commitdiff
Fix compilation on gcc 2.95 and other compilers that only allow
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 18 Jun 2012 17:47:01 +0000 (13:47 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 18 Jun 2012 17:47:01 +0000 (13:47 -0400)
variable declarations at the beginning of a block.

plugins/sudoers/logging.c
plugins/sudoers/sudoreplay.c

index 4d3e13e47e0e9c82c20ee5021a2d87cdb6d5ca8c..1f4fc6ac876d77ddd9d2f7627ea5c9d59b6c7d0a 100644 (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 */
index bcd6304f9c0cad03600cc9a7493edc26c6f2d41e..2abbf1b7cc4c88d68a75c076bf6d3bf7b7bcd0ce 100644 (file)
@@ -535,9 +535,10 @@ delay(double secs)
 static int
 open_io_fd(char *path, int len, const char *suffix, union io_fd *fdp)
 {
+    debug_decl(open_io_fd, SUDO_DEBUG_UTIL)
+
     path[len] = '\0';
     strlcat(path, suffix, PATH_MAX);
-    debug_decl(open_io_fd, SUDO_DEBUG_UTIL)
 
 #ifdef HAVE_ZLIB_H
     fdp->g = gzopen(path, "r");