summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-05-24 11:33:50 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-05-24 11:33:50 +0000
commitff4405b10fc287a13e8f0c0a9ae3229d8e42fe8a (patch)
tree220547660f6f3c5efe19fba090eac274536f4323
parent354c5ef6c32fc6a0c24ff13f2aafffb52225a67f (diff)
downloadmpfr-ff4405b10fc287a13e8f0c0a9ae3229d8e42fe8a.tar.gz
[tests/tsprintf.c] Fixed setlocale usage (problem detected with MinGW)
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". git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11533 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--tests/tsprintf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/tsprintf.c b/tests/tsprintf.c
index 2f392b33c..8d9a49770 100644
--- a/tests/tsprintf.c
+++ b/tests/tsprintf.c
@@ -1427,14 +1427,13 @@ percent_n (void)
int
main (int argc, char **argv)
{
- char *locale;
int k;
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 ();
@@ -1451,7 +1450,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
}