Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 6/6] decr and tmp are only used when HAVE_STRFTIME is defined, strict compilers will complain



---
 Src/utils.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Src/utils.c b/Src/utils.c
index 59b9435..cef2abe 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2712,8 +2712,11 @@ ztrftimebuf(int *bufsizeptr, int decr)
 mod_export int
 ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
 {
-    int hr12, decr;
-#ifndef HAVE_STRFTIME
+    int hr12;
+#ifdef HAVE_STRFTIME
+    int decr;
+    char tmp[4];
+#else
     static char *astr[] =
     {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
     static char *estr[] =
@@ -2721,7 +2724,6 @@ ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
      "Aug", "Sep", "Oct", "Nov", "Dec"};
 #endif
     char *origbuf = buf;
-    char tmp[4];
 
 
     while (*fmt)
-- 
1.8.3.2



Messages sorted by: Reverse Date, Date, Thread, Author