about summary refs log tree commit diff
path: root/locale/programs/locfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale/programs/locfile.c')
-rw-r--r--locale/programs/locfile.c11
1 files changed, 6 insertions, 5 deletions
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;