check if setlocale() returns NULL
This commit is contained in:
@@ -91,6 +91,8 @@ namespace
|
|||||||
|
|
||||||
void init_current_locale()
|
void init_current_locale()
|
||||||
{
|
{
|
||||||
|
if (!setlocale(LC_CTYPE, ""))
|
||||||
|
return;
|
||||||
std::string envlocale = setlocale(LC_CTYPE, "");
|
std::string envlocale = setlocale(LC_CTYPE, "");
|
||||||
if (envlocale.empty() || envlocale == "C")
|
if (envlocale.empty() || envlocale == "C")
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user