From f28b1dcc197c8775d6a34a419d73a0cfa97fa643 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Thu, 27 Apr 2017 21:26:54 +0900 Subject: [PATCH] Handle the case locale is 'C' in wchar-char-test. --- test/src/wchar-char-test.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/src/wchar-char-test.c b/test/src/wchar-char-test.c index 2763854..a763706 100644 --- a/test/src/wchar-char-test.c +++ b/test/src/wchar-char-test.c @@ -61,7 +61,8 @@ int main(int argc, char **argv) }; loc = setlocale(LC_ALL, ""); - if (NULL != (ptr = strchr(loc, '.'))) + if (NULL != loc && + NULL != (ptr = strchr(loc, '.'))) { int i; @@ -74,11 +75,11 @@ int main(int argc, char **argv) break; } } - if (testsw < 0) - { - printf("Unfortunately can't handle this locale\n"); - exit(0); - } + } + if (testsw < 0) + { + printf("Unfortunately can't handle this locale\n"); + exit(0); } test_connect_ext(""); -- 2.39.5