mirror of
https://sourceware.org/git/glibc.git
synced 2025-05-25 17:02:34 +03:00
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.
This commit is contained in:
parent
1ffe1ccb6e
commit
e69897bf20
@ -1,3 +1,10 @@
|
|||||||
|
2017-11-12 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
2017-11-12 Florian Weimer <fweimer@redhat.com>
|
2017-11-12 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
* support/support.h (xstrndup): Declare.
|
* support/support.h (xstrndup): Declare.
|
||||||
|
@ -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)
|
#define DO(field) fwrite(tzh.field, sizeof tzh.field, 1, fp)
|
||||||
tzh = tzh0;
|
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;
|
tzh.tzh_version[0] = version;
|
||||||
convert(thistypecnt, tzh.tzh_ttisgmtcnt);
|
convert(thistypecnt, tzh.tzh_ttisgmtcnt);
|
||||||
convert(thistypecnt, tzh.tzh_ttisstdcnt);
|
convert(thistypecnt, tzh.tzh_ttisstdcnt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user