diff options
Diffstat (limited to 'libX11/src/xlibi18n/lcFile.c')
-rw-r--r-- | libX11/src/xlibi18n/lcFile.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/libX11/src/xlibi18n/lcFile.c b/libX11/src/xlibi18n/lcFile.c index 18756c1ca..4e4439773 100644 --- a/libX11/src/xlibi18n/lcFile.c +++ b/libX11/src/xlibi18n/lcFile.c @@ -423,10 +423,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; } } @@ -579,8 +576,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; } @@ -729,8 +725,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; } @@ -828,8 +823,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; } |