The code uses 'errno' to detect errors, but the variable is not set to
zero before parsing the number. As a result, any previous error can
affect the width number parsing.
Signed-off-by: Karel Zak <kzak@redhat.com>
} else if (value && strncmp(name, "width", namesz) == 0) {
char *end = NULL;
- double x = strtod(value, &end);
+ double x;
+
+ errno = 0;
+ x = strtod(value, &end);
if (errno || value == end)
return -EINVAL;
rc = scols_column_set_whint(cl, x);