]> Savannah Git Hosting - gnulib.git/commitdiff
time_rz: port to pedantic memcpy
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 29 Jul 2015 20:48:10 +0000 (13:48 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 29 Jul 2015 20:48:44 +0000 (13:48 -0700)
* lib/time_rz.c (tzalloc): Pacify pedantic memcpy implementations
that reject memcpy (..., NULL, 0).

ChangeLog
lib/time_rz.c

index 95b5a9861c5c0d2b15995771d3dff070ca5c73f3..5d1977d9dd294def300469ef62ab1a4ac2fbd4c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-07-29  Paul Eggert  <eggert@cs.ucla.edu>
+
+       time_rz: port to pedantic memcpy
+       * lib/time_rz.c (tzalloc): Pacify pedantic memcpy implementations
+       that reject memcpy (..., NULL, 0).
+
 2015-07-27  Paul Eggert  <eggert@cs.ucla.edu>
 
        time_rz: port better to MinGW
index d5c6dd52cc26b5c5a7a6770a62d6d364d0344154..5e9636f3a3d4458e12665c0af8b466c8893697f9 100644 (file)
@@ -105,7 +105,9 @@ tzalloc (char const *name)
       tz->tzname_copy[0] = tz->tzname_copy[1] = NULL;
 #endif
       tz->tz_is_set = !!name;
-      extend_abbrs (tz->abbrs, name, name_size);
+      tz->abbrs[0] = '\0';
+      if (name)
+        extend_abbrs (tz->abbrs, name, name_size);
     }
   return tz;
 }