about summary refs log tree commit diff
path: root/locale/programs/ld-time.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale/programs/ld-time.c')
-rw-r--r--locale/programs/ld-time.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
index 2d63275d3c..78aff7fee6 100644
--- a/locale/programs/ld-time.c
+++ b/locale/programs/ld-time.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
@@ -468,9 +468,14 @@ No definition for %s category found"), "LC_TIME"));
 	  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;
-	  wstr = wstr ? wcschr (wstr + 1, L':') : NULL;	/* end name */
-	  *wstr = L'\0';
-	  time->era_entries[idx].wformat = (uint32_t *) wstr + 1;
+	  if (wstr != NULL)
+	    {
+	      wstr = wcschr (wstr + 1, L':');	/* end name */
+	      *wstr = L'\0';
+	      time->era_entries[idx].wformat = (uint32_t *) wstr + 1;
+	    }
+	  else
+	    time->era_entries[idx].wformat = NULL;
 	}
     }