From 57ea367963865051d1b2b7019fcebeec78238535 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 10 Feb 2016 11:58:05 +0100 Subject: 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. --- player/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player/client.c b/player/client.c index 3abc8d8086..80019f04d8 100644 --- a/player/client.c +++ b/player/client.c @@ -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) -- cgit v1.2.3