summaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/ld-time.c13
-rw-r--r--locale/programs/locfile.c11
2 files changed, 15 insertions, 9 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;
}
}
diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
index bc12fbb332..ae8ce73ce4 100644
--- a/locale/programs/locfile.c
+++ b/locale/programs/locfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
@@ -155,10 +155,11 @@ argument to `%s' must be a single character"),
if (repertoire_name == NULL)
{
- repertoire_name = memcpy (xmalloc (arg->val.str.lenmb + 1),
- arg->val.str.startmb,
- arg->val.str.lenmb);
- ((char *) repertoire_name)[arg->val.str.lenmb] = '\0';
+ char *newp = alloca (arg->val.str.lenmb + 1);
+
+ *((char *) mempcpy (newp, arg->val.str.startmb,
+ arg->val.str.lenmb)) = '\0';
+ repertoire_name = newp;
}
break;