diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2025-03-24 19:52:57 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2025-03-24 21:28:43 +0100 |
commit | 6a6bf01b75d3b0a9188442ad62992003b756cdf6 (patch) | |
tree | 8d746cd6934165e1767bc40f075ac1e5834d5406 | |
parent | ad6700ac566e7c5cc7bb7d1ef573652299256885 (diff) | |
download | newlib-6a6bf01b75d3b0a9188442ad62992003b756cdf6.zip newlib-6a6bf01b75d3b0a9188442ad62992003b756cdf6.tar.gz newlib-6a6bf01b75d3b0a9188442ad62992003b756cdf6.tar.bz2 |
getlocalename_l: fix return value in LC_GLOBAL_LOCALE case
The data was written to the per-reent getlocalename buffer,
but the value wasn't returned.
Fixes: 71511d4ac868 ("getlocalename_l: implement per SUS Base Specifications Issue 8 draft")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | newlib/libc/locale/getlocalename_l.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/newlib/libc/locale/getlocalename_l.c b/newlib/libc/locale/getlocalename_l.c index 7060c8d..1233bd9 100644 --- a/newlib/libc/locale/getlocalename_l.c +++ b/newlib/libc/locale/getlocalename_l.c @@ -63,8 +63,8 @@ _getlocalename_l_r (struct _reent *ptr, int category, struct __locale_t *locobj) /* getlocalename_l is supposed to return the value in a thread-safe manner. This requires to copy over the category string into thread-local storage. */ - strcpy (_REENT_GETLOCALENAME_L_BUF (ptr), - __get_global_locale ()->categories[category]); + return strcpy (_REENT_GETLOCALENAME_L_BUF (ptr), + __get_global_locale ()->categories[category]); } return locobj->categories[category]; #endif |