changeset 18071:e79f94c5963f

time_rz: port to pedantic memcpy * lib/time_rz.c (tzalloc): Pacify pedantic memcpy implementations that reject memcpy (..., NULL, 0).
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 29 Jul 2015 13:48:10 -0700 (2015-07-29)
parents d460ec17f09f
children 1a83dacc0869
files ChangeLog lib/time_rz.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/lib/time_rz.c
+++ b/lib/time_rz.c
@@ -105,7 +105,9 @@
       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;
 }