aboutsummaryrefslogtreecommitdiff
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 2eeed96141..1d3276a6bf 100644
--- a/locale/programs/locfile.c
+++ b/locale/programs/locfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
@@ -64,11 +64,12 @@ locfile_read (struct localedef_t *result, const struct charmap_t *charmap)
char *i18npath = getenv ("I18NPATH");
if (i18npath != NULL && *i18npath != '\0')
{
- char path[strlen (filename) + 1 + strlen (i18npath)
- + sizeof ("/locales/") - 1];
+ const size_t pathlen = strlen (i18npath);
+ char i18npathbuf[pathlen + 1];
+ char path[strlen (filename) + 1 + pathlen
+ + sizeof ("/locales/") - 1];
char *next;
- i18npath = strdupa (i18npath);
-
+ i18npath = memcpy (i18npathbuf, i18npath, pathlen + 1);
while (ldfile == NULL
&& (next = strsep (&i18npath, ":")) != NULL)