diff options
Diffstat (limited to 'nx-X11/lib/X11/lcFile.c')
-rw-r--r-- | nx-X11/lib/X11/lcFile.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/nx-X11/lib/X11/lcFile.c b/nx-X11/lib/X11/lcFile.c index e657e707f..36f0ddf5a 100644 --- a/nx-X11/lib/X11/lcFile.c +++ b/nx-X11/lib/X11/lcFile.c @@ -401,10 +401,7 @@ resolve_name( from = args[1], to = args[0]; /* right to left */ } if (! strcmp(from, lc_name)) { - name = Xmalloc(strlen(to) + 1); - if (name != NULL) { - strcpy(name, to); - } + name = strdup(to); break; } } @@ -557,8 +554,7 @@ _XlcResolveLocaleName( if (name == NULL) { /* vendor locale name == Xlocale name, no expansion of alias */ - pub->siname = Xmalloc (strlen (lc_name) + 1); - strcpy (pub->siname, lc_name); + pub->siname = strdup (lc_name); } else { pub->siname = name; } @@ -707,8 +703,7 @@ _XlcLocaleDirName(char *dir_name, size_t dir_len, char *lc_name) last_dir_len = strlen (dir_name) + 1; last_dir_name = Xmalloc (last_dir_len); strcpy (last_dir_name, dir_name); - last_lc_name = Xmalloc (strlen (lc_name) + 1); - strcpy (last_lc_name, lc_name); + last_lc_name = strdup (lc_name); return dir_name; } @@ -806,8 +801,7 @@ _XlcLocaleLibDirName(char *dir_name, size_t dir_len, char *lc_name) last_dir_len = strlen (dir_name) + 1; last_dir_name = Xmalloc (last_dir_len); strcpy (last_dir_name, dir_name); - last_lc_name = Xmalloc (strlen (lc_name) + 1); - strcpy (last_lc_name, lc_name); + last_lc_name = strdup (lc_name); return dir_name; } |