projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix x32 unistd macros to report as ILP32 not LP64
[musl]
/
src
/
locale
/
duplocale.c
diff --git
a/src/locale/duplocale.c
b/src/locale/duplocale.c
index
1336870
..
030b64c
100644
(file)
--- a/
src/locale/duplocale.c
+++ b/
src/locale/duplocale.c
@@
-5,16
+5,10
@@
locale_t __duplocale(locale_t old)
{
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;
if (!new) return 0;
- new->messages_name = (void *)(new+1);
-
if (old == LC_GLOBAL_LOCALE) old = &libc.global_locale;
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);
-
- if (new && old != LC_GLOBAL_LOCALE) memcpy(new, old, sizeof *new);
+ *new = *old;
return new;
}
return new;
}