mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 18:27:56 +08:00
libs/libc/locale/lib_setlocale.c: Improved error handling in setlocale().
This commit is contained in:
@@ -63,6 +63,11 @@
|
||||
|
||||
FAR char *setlocale(int category, FAR const char *locale)
|
||||
{
|
||||
if (locale == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ((strcmp(locale, "POSIX") == 0 || strcmp(locale, "C") == 0 ||
|
||||
strcmp(locale, "") == 0) ? "C" : NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user