diff --git a/src/prefsparser.cc b/src/prefsparser.cc index 049d4b5..e489fff 100644 --- a/src/prefsparser.cc +++ b/src/prefsparser.cc @@ -146,7 +146,7 @@ static int parseOption(char *name, char *value, */ void PrefsParser::parse(FILE *fp) { - char *line, *name, *value, *oldLocale; + char *line, *name, *value; int st, line_number = 1; /* Symbol array, sorted alphabetically */ @@ -252,7 +252,7 @@ void PrefsParser::parse(FILE *fp) }; // changing the LC_NUMERIC locale (temporarily) to C // avoids parsing problems with float numbers - oldLocale = dStrdup(setlocale(LC_NUMERIC, NULL)); + std::string oldLocale = setlocale(LC_NUMERIC, NULL); setlocale(LC_NUMERIC, "C"); // scan the file line by line @@ -272,6 +272,5 @@ void PrefsParser::parse(FILE *fp) fclose(fp); // restore the old numeric locale - setlocale(LC_NUMERIC, oldLocale); - dFree(oldLocale); + setlocale(LC_NUMERIC, oldLocale.c_str()); }