]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Address clang warning.
authorMichael R Sweet <msweet@msweet.org>
Mon, 15 Apr 2024 19:02:37 +0000 (15:02 -0400)
committerMichael R Sweet <msweet@msweet.org>
Mon, 15 Apr 2024 19:02:37 +0000 (15:02 -0400)
scheduler/log.c

index 78b11aacedafbbdfa78ec49bc8e41d6729cfb80f..62a8e24aefcad5add3fceffab473be68026d8f6b 100644 (file)
@@ -357,22 +357,28 @@ cupsdGetDateTime(struct timeval *t,       /* I - Time value or NULL for current */
 
     localtime_r(&(t->tv_sec), &date);
 
+#ifdef HAVE_TM_GMTOFF
     if (format == CUPSD_TIME_STANDARD)
       snprintf(s, sizeof(s), "[%02d/%s/%04d:%02d:%02d:%02d %+03ld%02ld]",
               date.tm_mday, months[date.tm_mon], 1900 + date.tm_year,
               date.tm_hour, date.tm_min, date.tm_sec,
-#ifdef HAVE_TM_GMTOFF
               date.tm_gmtoff / 3600, (date.tm_gmtoff / 60) % 60);
-#else
-              timezone / 3600, (timezone / 60) % 60);
-#endif /* HAVE_TM_GMTOFF */
     else
       snprintf(s, sizeof(s), "[%02d/%s/%04d:%02d:%02d:%02d.%06d %+03ld%02ld]",
               date.tm_mday, months[date.tm_mon], 1900 + date.tm_year,
               date.tm_hour, date.tm_min, date.tm_sec, (int)t->tv_usec,
-#ifdef HAVE_TM_GMTOFF
               date.tm_gmtoff / 3600, (date.tm_gmtoff / 60) % 60);
+
 #else
+    if (format == CUPSD_TIME_STANDARD)
+      snprintf(s, sizeof(s), "[%02d/%s/%04d:%02d:%02d:%02d %+03ld%02ld]",
+              date.tm_mday, months[date.tm_mon], 1900 + date.tm_year,
+              date.tm_hour, date.tm_min, date.tm_sec,
+              timezone / 3600, (timezone / 60) % 60);
+    else
+      snprintf(s, sizeof(s), "[%02d/%s/%04d:%02d:%02d:%02d.%06d %+03ld%02ld]",
+              date.tm_mday, months[date.tm_mon], 1900 + date.tm_year,
+              date.tm_hour, date.tm_min, date.tm_sec, (int)t->tv_usec,
               timezone / 3600, (timezone / 60) % 60);
 #endif /* HAVE_TM_GMTOFF */
   }