From 9c70545fde260c33694ba56cf8ddf8b8cfc45b71 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 29 Jul 2015 13:48:10 -0700 Subject: [PATCH] time_rz: port to pedantic memcpy * 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 95b5a9861c..5d1977d9dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-07-29 Paul Eggert + + 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 time_rz: port better to MinGW diff --git a/lib/time_rz.c b/lib/time_rz.c index d5c6dd52cc..5e9636f3a3 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.39.5