From b38d83c41700ca440ba85e23127124afc39cf670 Mon Sep 17 00:00:00 2001 From: vlefevre Date: Sun, 28 May 2017 22:12:53 +0000 Subject: [tests/tsprintf.c] Fixed setlocale usage (problem detected with MinGW in the trunk) by not using the returned string any longer. Indeed, ISO C99 says that this string "may be overwritten by a subsequent call to the setlocale function". The tests in the 3.1 branch are different, so that this problem was not detected here on the tested platforms, including MinGW. (merged changeset r11533 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11540 280ebfd0-de03-0410-8827-d642c229c3f4 --- tests/tsprintf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/tsprintf.c b/tests/tsprintf.c index e9c1f1422..737ff86db 100644 --- a/tests/tsprintf.c +++ b/tests/tsprintf.c @@ -1273,13 +1273,12 @@ test20161214 (void) int main (int argc, char **argv) { - char *locale; tests_start_mpfr (); #if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE) /* currently, we just check with 'C' locale */ - locale = setlocale (LC_ALL, "C"); + setlocale (LC_ALL, "C"); #endif bug20111102 (); @@ -1297,7 +1296,7 @@ main (int argc, char **argv) locale_da_DK (); /* Avoid a warning by doing the setlocale outside of this #if */ #endif - setlocale (LC_ALL, locale); + setlocale (LC_ALL, "C"); #endif if (getenv ("MPFR_CHECK_LIBC_PRINTF")) -- cgit v1.2.1