about summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-05-11 17:11:16 +0000
committerUlrich Drepper <drepper@redhat.com>2006-05-11 17:11:16 +0000
commit3d237e425c326606721bed45c741729c35133c5f (patch)
treea34ae8e1723a04de989c83e987d79a96b60e2de8 /locale
parent790fc6e41d5f4e888b938be1d653fb23fdf3540c (diff)
downloadglibc-3d237e425c326606721bed45c741729c35133c5f.tar.gz
glibc-3d237e425c326606721bed45c741729c35133c5f.tar.xz
glibc-3d237e425c326606721bed45c741729c35133c5f.zip
* locale/programs/ld-time.c (time_finish): If wide era name or
	format aren't provided, set both wname and wformat to L"".
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/ld-time.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
index 78aff7fee6..4f1dcb0ce7 100644
--- a/locale/programs/ld-time.c
+++ b/locale/programs/ld-time.c
@@ -467,15 +467,22 @@ No definition for %s category found"), "LC_TIME"));
 	  wstr = wstr ? wcschr (wstr + 1, L':') : NULL;	/* end offset */
 	  wstr = wstr ? wcschr (wstr + 1, L':') : NULL;	/* end start */
 	  wstr = wstr ? wcschr (wstr + 1, L':') : NULL;	/* end end */
-	  time->era_entries[idx].wname = (uint32_t *) wstr + 1;
 	  if (wstr != NULL)
 	    {
+	      time->era_entries[idx].wname = (uint32_t *) wstr + 1;
 	      wstr = wcschr (wstr + 1, L':');	/* end name */
-	      *wstr = L'\0';
-	      time->era_entries[idx].wformat = (uint32_t *) wstr + 1;
+	      if (wstr != NULL)
+		{
+		  *wstr = L'\0';
+		  time->era_entries[idx].wformat = (uint32_t *) wstr + 1;
+		}
+	      else
+		time->era_entries[idx].wname =
+		  time->era_entries[idx].wformat = (uint32_t *) L"";
 	    }
 	  else
-	    time->era_entries[idx].wformat = NULL;
+	    time->era_entries[idx].wname =
+	      time->era_entries[idx].wformat = (uint32_t *) L"";
 	}
     }