mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 03:10:27 +00:00
Return "" locale when parameter is null
This commit is contained in:
parent
36892c4dd6
commit
f1a2b8d33b
1 changed files with 3 additions and 0 deletions
|
@ -66,6 +66,9 @@ char *nl_langinfo_l(nl_item item, locale_t loc)
|
||||||
int idx = item & 65535;
|
int idx = item & 65535;
|
||||||
const char *str;
|
const char *str;
|
||||||
|
|
||||||
|
if (!loc)
|
||||||
|
return "";
|
||||||
|
|
||||||
if (item == CODESET) return loc->cat[LC_CTYPE] ? "UTF-8" : "ASCII";
|
if (item == CODESET) return loc->cat[LC_CTYPE] ? "UTF-8" : "ASCII";
|
||||||
|
|
||||||
/* _NL_LOCALE_NAME extension */
|
/* _NL_LOCALE_NAME extension */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue