}
unsigned int
-xatoui(const char *token)
+xatoui(const char *token, char eov)
{
- int64_t input = xatoll(token, 10);
+ int64_t input = xatoll(token, 10, eov);
if (input < 0) {
debugs(0, DBG_PARSE_NOTE(DBG_IMPORTANT), "ERROR: The input value '" << token << "' cannot be less than 0.");
self_destruct();
}
int64_t
-xatoll(const char *token, int base)
+xatoll(const char *token, int base, char eov)
{
char *end = NULL;
int64_t ret = strtoll(token, &end, base);
self_destruct();
}
- if (*end) {
+ if (*end != eov) {
debugs(0, DBG_PARSE_NOTE(DBG_IMPORTANT), "ERROR: Invalid value: '" << token << "' is supposed to be a number.");
self_destruct();
}
double xatof(const char *token);
int xatoi(const char *token);
-unsigned int xatoui(const char *token);
+unsigned int xatoui(const char *token, char eov = '\0');
long xatol(const char *token);
-int64_t xatoll(const char *token, int base);
+int64_t xatoll(const char *token, int base, char eov = '\0');
unsigned short xatos(const char *token);
/**
} else if (strncmp(token, "tcpkeepalive=", 13) == 0) {
char *t = token + 13;
s->tcp_keepalive.enabled = 1;
- s->tcp_keepalive.idle = xatoui(t);
+ s->tcp_keepalive.idle = xatoui(t,',');
t = strchr(t, ',');
if (t) {
++t;
- s->tcp_keepalive.interval = xatoui(t);
+ s->tcp_keepalive.interval = xatoui(t,',');
t = strchr(t, ',');
}
if (t) {
++t;
s->tcp_keepalive.timeout = xatoui(t);
- // t = strchr(t, ','); // not really needed, left in as documentation
}
#if USE_SSL
} else if (strcasecmp(token, "sslBump") == 0) {