char *end;
double v;
char *saved_locale;
+ char locstr[64]; /* enough? */
int err;
if (!*str)
return -EINVAL;
saved_locale = setlocale(LC_NUMERIC, NULL);
- setlocale(LC_NUMERIC, "C");
+ if (saved_locale) {
+ snprintf(locstr, sizeof(locstr), "%s", saved_locale);
+ setlocale(LC_NUMERIC, "C");
+ }
errno = 0;
v = strtod(str, &end);
err = -errno;
- setlocale(LC_NUMERIC, saved_locale);
+ if (saved_locale)
+ setlocale(LC_NUMERIC, locstr);
if (err)
return err;
if (*end)
snd_config_t *n = NULL;
if (!skip) {
- char static_id[12];
+ char static_id[12];
snprintf(static_id, sizeof(static_id), "%i", idx);
id = strdup(static_id);
if (id == NULL)