about summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-06-12 20:17:22 +0000
committerUlrich Drepper <drepper@redhat.com>2003-06-12 20:17:22 +0000
commitad316adfa6d389f27f726e1e377a66e3cdd9748e (patch)
tree7ba4a82d64c50087a56c41a3a1855db1d56f16ef /locale
parent66b110e855159d415b5106ade7fa5bf17c14f108 (diff)
downloadglibc-ad316adfa6d389f27f726e1e377a66e3cdd9748e.tar.gz
glibc-ad316adfa6d389f27f726e1e377a66e3cdd9748e.tar.xz
glibc-ad316adfa6d389f27f726e1e377a66e3cdd9748e.zip
Update.
2003-06-12  Ulrich Drepper  <drepper@redhat.com>

	* scripts/config.guess: Update from upstream version.
	* scripts/config.sub: Likewise.

2003-06-12  Jakub Jelinek  <jakub@redhat.com>

	* locale/programs/ld-time.c (time_output): Also copy the era format,
	not only the name.
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/ld-time.c15
1 files changed, 7 insertions, 8 deletions
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);