errno = 0;
tmpint = strtoimax(strval, &endptr, 0);
- if (strval[0] == '\0' || *endptr != '\0')
+ if (strval[0] == '\0' || *endptr != '\0') {
+ SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, "malformed integer value "
+ "for %s: '%s'", name, strval);
return 0;
- if (errno == ERANGE && (tmpint == INTMAX_MAX || tmpint == INTMAX_MIN))
+ }
+ if (errno == ERANGE && (tmpint == INTMAX_MAX || tmpint == INTMAX_MIN)) {
+ SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, "integer value for %s out "
+ "of range: '%s'", name, strval);
return 0;
+ }
*val = tmpint;
return 1;
return 0;
errno = 0;
tmpint = strtoimax(strval, &endptr, 0);
- if (strval[0] == '\0' || *endptr != '\0')
+ if (strval[0] == '\0' || *endptr != '\0') {
+ SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, "malformed integer value "
+ "for %s with base %s: '%s'", name, base->name, strval);
return 0;
- if (errno == ERANGE && (tmpint == INTMAX_MAX || tmpint == INTMAX_MIN))
+ }
+ if (errno == ERANGE && (tmpint == INTMAX_MAX || tmpint == INTMAX_MIN)) {
+ SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, "integer value for %s with "
+ " base %s out of range: '%s'", name, base->name, strval);
return 0;
+ }
*val = tmpint;
return 1;