summary refs log tree commit diff
path: root/timezone
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-11-12 22:00:28 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2017-11-12 22:00:28 -0800
commite69897bf202e18034cbef26f363bae64de70a196 (patch)
treee51c03b97276c729adb29b99b59eccb7f1a3e2bc /timezone
parent1ffe1ccb6ec5771765f1f6f0c439ed07bf345d67 (diff)
downloadglibc-e69897bf202e18034cbef26f363bae64de70a196.tar.gz
glibc-e69897bf202e18034cbef26f363bae64de70a196.tar.xz
glibc-e69897bf202e18034cbef26f363bae64de70a196.zip
timezone: pacify GCC -Wstringop-truncation
Problem reported by Martin Sebor in:
https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
* timezone/zic.c (writezone): Use memcpy, not strncpy.
Diffstat (limited to 'timezone')
-rw-r--r--timezone/zic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/timezone/zic.c b/timezone/zic.c
index 946bf6ff8e..e738386600 100644
--- a/timezone/zic.c
+++ b/timezone/zic.c
@@ -1949,7 +1949,7 @@ writezone(const char *const name, const char *const string, char version)
 		}
 #define DO(field)	fwrite(tzh.field, sizeof tzh.field, 1, fp)
 		tzh = tzh0;
-		strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+		memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
 		tzh.tzh_version[0] = version;
 		convert(thistypecnt, tzh.tzh_ttisgmtcnt);
 		convert(thistypecnt, tzh.tzh_ttisstdcnt);