# HG changeset patch # User Chris Cannam # Date 1541687974 0 # Node ID c36ffc19598879cd9036957c5c70484b2b24e664 # Parent 5fe24e4af12c02ea8b01cb4a14bd64cbbde7749d Fix usage of setlocale diff -r 5fe24e4af12c -r c36ffc195988 base/RealTimeSV.cpp --- 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;