bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] time_rz: port to pedantic memcpy


From: Paul Eggert
Subject: [PATCH] time_rz: port to pedantic memcpy
Date: Wed, 29 Jul 2015 13:49:02 -0700

* lib/time_rz.c (tzalloc): Pacify pedantic memcpy implementations
that reject memcpy (..., NULL, 0).
---
 ChangeLog     | 6 ++++++
 lib/time_rz.c | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 95b5a98..5d1977d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-07-29  Paul Eggert  <address@hidden>
+
+       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  <address@hidden>
 
        time_rz: port better to MinGW
diff --git a/lib/time_rz.c b/lib/time_rz.c
index d5c6dd5..5e9636f 100644
--- a/lib/time_rz.c
+++ b/lib/time_rz.c
@@ -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;
 }
-- 
2.1.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]