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:
parent
7caecc53b0
commit
57ea367963
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user