X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect_chain_test.cpp;h=32beb41b45df0c4e67c7490f884f3581eb2b2963;hp=596570c67dd3dc6858ea0815c7202d1e50936c67;hb=4cf76ac1b1565a8710b2906dbd2d03a2b53cedfe;hpb=f21268c5ec0607dadc42775d186b27704c18a399 diff --git a/effect_chain_test.cpp b/effect_chain_test.cpp index 596570c..32beb41 100644 --- a/effect_chain_test.cpp +++ b/effect_chain_test.cpp @@ -1248,7 +1248,12 @@ TEST(EffectChainTest, StringStreamLocalesWork) { // the test will always succeed. Note that the OpenGL driver might call // setlocale() behind-the-scenes, and that might corrupt the returned // pointer, so we need to take our own copy of it here. - char *saved_locale = strdup(setlocale(LC_ALL, "nb_NO.UTF_8")); + char *saved_locale = setlocale(LC_ALL, "nb_NO.UTF_8"); + if (saved_locale == NULL) { + // The locale wasn't available. + return; + } + saved_locale = strdup(saved_locale); float data[] = { 0.0f, 0.0f, 0.0f, 0.0f, };