From ad316adfa6d389f27f726e1e377a66e3cdd9748e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 12 Jun 2003 20:17:22 +0000 Subject: Update. 2003-06-12 Ulrich Drepper * scripts/config.guess: Update from upstream version. * scripts/config.sub: Likewise. 2003-06-12 Jakub Jelinek * locale/programs/ld-time.c (time_output): Also copy the era format, not only the name. --- locale/programs/ld-time.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'locale') diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c index a9d46597f1..f0a0f0fff7 100644 --- a/locale/programs/ld-time.c +++ b/locale/programs/ld-time.c @@ -670,7 +670,7 @@ time_output (struct localedef_t *locale, const struct charmap_t *charmap, idx[1 + last_idx] = idx[last_idx]; for (num = 0; num < time->num_era; ++num) { - size_t l; + size_t l, l2; iov[2 + cnt].iov_base = (void *) &time->era_entries[num].direction; iov[2 + cnt].iov_len = sizeof (int32_t); @@ -699,15 +699,14 @@ time_output (struct localedef_t *locale, const struct charmap_t *charmap, l = ((char *) rawmemchr (time->era_entries[num].format, '\0') - time->era_entries[num].name) + 1; - l = (l + 3) & ~3; - iov[2 + cnt].iov_base = alloca (l); - /* This time we *really* want to use the properties of strncpy. */ - strncpy (iov[2 + cnt].iov_base, time->era_entries[num].name, - l); - iov[2 + cnt].iov_len = l; + l2 = (l + 3) & ~3; + iov[2 + cnt].iov_base = alloca (l2); + memset (mempcpy (iov[2 + cnt].iov_base, time->era_entries[num].name, l), + '\0', l2 - l); + iov[2 + cnt].iov_len = l2; ++cnt; - idx[1 + last_idx] += 8 * sizeof (int32_t) + l; + idx[1 + last_idx] += 8 * sizeof (int32_t) + l2; assert (idx[1 + last_idx] % 4 == 0); -- cgit v1.2.3