1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 01:22:30 +00:00

player: assume setlocale() returns NULL if locales are not supported

It would make somewhat sense for libcs which don't implement locales at
all, such as Bionic.

Beyond that, setlocale() is specified that it can return NULL, and we
shouldn't crash if that happens.
This commit is contained in:
wm4 2016-02-10 11:58:05 +01:00
parent 7caecc53b0
commit 57ea367963

View File

@ -458,7 +458,7 @@ void mpv_terminate_destroy(mpv_handle *ctx)
static bool check_locale(void)
{
char *name = setlocale(LC_NUMERIC, NULL);
return strcmp(name, "C") == 0;
return !name || strcmp(name, "C") == 0;
}
mpv_handle *mpv_create(void)