Fix for possible NULL return value for setlocale() (Zarafa).

This commit is contained in:
Vincent Richard 2008-07-11 21:07:32 +00:00
parent 1d093c46a7
commit 166f6206f4

View File

@ -113,9 +113,9 @@ const vmime::datetime posixHandler::getCurrentLocalTime() const
const vmime::charset posixHandler::getLocaleCharset() const
{
vmime::string prevLocale(::setlocale(LC_ALL, ""));
const char* prevLocale = ::setlocale(LC_ALL, "");
vmime::charset ch(::nl_langinfo(CODESET));
::setlocale(LC_ALL, prevLocale.c_str());
::setlocale(LC_ALL, prevLocale);
return (ch);
}