changeset 1572:c36ffc195988 spectrogramparam

Fix usage of setlocale
author Chris Cannam
date Thu, 08 Nov 2018 14:39:34 +0000
parents 5fe24e4af12c
children f04038819c26
files base/RealTimeSV.cpp
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/base/RealTimeSV.cpp	Thu Nov 08 12:56:03 2018 +0000
+++ b/base/RealTimeSV.cpp	Thu Nov 08 14:39:34 2018 +0000
@@ -100,8 +100,7 @@
     int year = 0, month = 0, day = 0, hour = 0, minute = 0;
     double second = 0.0;
 
-    char *loc = setlocale(LC_NUMERIC, 0);
-    (void)setlocale(LC_NUMERIC, "C"); // avoid strtod expecting ,-separator in DE
+    char *formerLoc = setlocale(LC_NUMERIC, "C"); // avoid strtod expecting ,-separator in DE
 
     int i = 0;
 
@@ -169,7 +168,7 @@
 
     t = t + fromSeconds(second);
 
-    setlocale(LC_NUMERIC, loc);
+    setlocale(LC_NUMERIC, formerLoc);
     
     if (negative) {
         return -t;