check if setlocale() returns NULL

This commit is contained in:
Andrzej Rybczak
2009-03-08 15:55:41 +01:00
parent 7f2a635ac5
commit 09ea91e548

View File

@@ -91,6 +91,8 @@ namespace
void init_current_locale()
{
if (!setlocale(LC_CTYPE, ""))
return;
std::string envlocale = setlocale(LC_CTYPE, "");
if (envlocale.empty() || envlocale == "C")
return;