summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-10 11:58:05 +0100
committerwm4 <wm4@nowhere>2016-02-10 11:58:05 +0100
commit57ea367963865051d1b2b7019fcebeec78238535 (patch)
tree2fbdbf090324315fda54dd5ecd7ee8164eb02e02
parent7caecc53b0b8ac1805fa498fb9dbe9379f3053d4 (diff)
downloadmpv-57ea367963865051d1b2b7019fcebeec78238535.tar.bz2
mpv-57ea367963865051d1b2b7019fcebeec78238535.tar.xz
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.
-rw-r--r--player/client.c2
1 files changed, 1 insertions, 1 deletions
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)