VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs)
{
char buf[MAX_STRING_LEN];
- char *s, *p;
+ char *s, *p, *next;
uint32_t lo, hi;
uint32_t port = request->vp_integer;
}
/* Same size */
- strcpy(buf, (char *)check->vp_strvalue);
- s = strtok(buf, ",");
+ strcpy(buf, check->vp_strvalue);
+
+ s = buf;
+ while (1) {
+ next = strchr(s, ',');
+ if (next) *next = '\0';
- while (s != NULL) {
if ((p = strchr(s, '-')) != NULL)
p++;
else
if (lo <= port && port <= hi) {
return 0;
}
- s = strtok(NULL, ",");
+
+ if (!next) break;
+ s = next + 1;
}
return -1;