libs/libc/locale/lib_setlocale.c: Improved error handling in setlocale().

This commit is contained in:
Joao Matos 2019-04-04 10:38:57 -06:00 committed by Gregory Nutt
parent 604f699711
commit 251009de3a

View File

@ -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);
}