diff options
Diffstat (limited to 'src/locale/duplocale.c')
-rw-r--r-- | src/locale/duplocale.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/locale/duplocale.c b/src/locale/duplocale.c index b87c933e..030b64cb 100644 --- a/src/locale/duplocale.c +++ b/src/locale/duplocale.c @@ -5,17 +5,10 @@ locale_t __duplocale(locale_t old) { - locale_t new = calloc(1, sizeof *new + LOCALE_NAME_MAX + 1); + locale_t new = malloc(sizeof *new); if (!new) return 0; - new->messages_name = (void *)(new+1); - if (old == LC_GLOBAL_LOCALE) old = &libc.global_locale; - new->ctype_utf8 = old->ctype_utf8; - if (old->messages_name) - strcpy(new->messages_name, old->messages_name); - - for (size_t i=0; i<sizeof new->cat/sizeof new->cat[0]; i++) - new->cat[i] = old->cat[i]; + *new = *old; return new; } |