summaryrefslogtreecommitdiff
path: root/libs/pbd/locale_guard.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/locale_guard.cc')
-rw-r--r--libs/pbd/locale_guard.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/libs/pbd/locale_guard.cc b/libs/pbd/locale_guard.cc
index b8493cf176..aa5a575521 100644
--- a/libs/pbd/locale_guard.cc
+++ b/libs/pbd/locale_guard.cc
@@ -29,13 +29,14 @@ using namespace PBD;
std::string PBD::LocaleGuard::current;
LocaleGuard::LocaleGuard (const char* str)
- : old(0)
+ : old(0)
{
if (current != str) {
old = strdup (setlocale (LC_NUMERIC, NULL));
if (strcmp (old, str)) {
- if (setlocale (LC_NUMERIC, str))
- current = str;
+ if (setlocale (LC_NUMERIC, str)) {
+ current = str;
+ }
}
}
}
@@ -43,11 +44,11 @@ LocaleGuard::LocaleGuard (const char* str)
LocaleGuard::~LocaleGuard ()
{
if (old) {
- if (setlocale (LC_NUMERIC, old))
+ if (setlocale (LC_NUMERIC, old)) {
current = old;
+ }
- free ((char*)old);
+ free (old);
}
}
-