]> Savannah Git Hosting - gnulib.git/commitdiff
nstrftime, c-nstrftime: Fix crash on Solaris 11.4.
authorBruno Haible <bruno@clisp.org>
Mon, 17 Jun 2024 14:47:56 +0000 (16:47 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 17 Jun 2024 14:47:56 +0000 (16:47 +0200)
* lib/strftime.c (__strftime_internal): Restore protection against zone
being NULL.

ChangeLog
lib/strftime.c

index 95aa6ef1078271b1df00d79863a882f9eecad1c3..aaf0153f092067e98537f42f400ff52c3ccb3001 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-06-17  Bruno Haible  <bruno@clisp.org>
+
+       nstrftime, c-nstrftime: Fix crash on Solaris 11.4.
+       * lib/strftime.c (__strftime_internal): Restore protection against zone
+       being NULL.
+
 2024-06-17  Bruno Haible  <bruno@clisp.org>
 
        time_rz: Fix link errors on NetBSD (regression yesterday).
index e33dbb8f7cc4372d8f4355cb05bddbec5f96a067..e422267913e5b2818623543d592b4a67e2bfe148 100644 (file)
@@ -949,6 +949,8 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
         zone = "GMT";
     }
 #endif
+  if (! zone)
+    zone = "";
 
   if (hour12 > 12)
     hour12 -= 12;