Skip to content
Snippets Groups Projects
Commit 26477cec authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Add symbolic value INT_MAX for XT_CONFIG_DEFAULT_IDXVEC_AUTOCONVERT_SIZE.

* This simplifies effectively disabling this feature.
parent 74c1f336
No related branches found
No related tags found
No related merge requests found
......@@ -247,7 +247,13 @@ xt_config_defaults_init(void)
config_env = getenv("XT_CONFIG_DEFAULT_IDXVEC_AUTOCONVERT_SIZE");
if (config_env) {
char *endptr;
long v = strtol(config_env, &endptr, 0);
long v;
errno = 0;
if (!strcmp(config_env, "INT_MAX")) {
v = INT_MAX;
endptr = (char *)config_env + 7;
} else
v = strtol(config_env, &endptr, 0);
if ((errno == ERANGE && (v == LONG_MAX || v == LONG_MIN))
|| (errno != 0 && v == 0)) {
perror("failed to parse value of "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment