From: Paul Eggert Date: Wed, 29 Jul 2015 20:48:10 +0000 (-0700) Subject: time_rz: port to pedantic memcpy X-Git-Tag: v1.0~6987 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=9c70545fde260c33694ba56cf8ddf8b8cfc45b71;p=gnulib.git time_rz: port to pedantic memcpy * lib/time_rz.c (tzalloc): Pacify pedantic memcpy implementations that reject memcpy (..., NULL, 0). --- 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; }