Commit 5bf319c1 authored by Evan Hunt's avatar Evan Hunt

complete strtok fix

(cherry picked from commit 74c3b9d3)
parent aafdc4c3
...@@ -458,7 +458,6 @@ parse_fuzz_arg(void) { ...@@ -458,7 +458,6 @@ parse_fuzz_arg(void) {
static void static void
parse_T_opt(char *option) { parse_T_opt(char *option) {
const char *p; const char *p;
char *last = NULL;
/* /*
* force the server to behave (or misbehave) in * force the server to behave (or misbehave) in
* specified ways for testing purposes. * specified ways for testing purposes.
...@@ -501,7 +500,7 @@ parse_T_opt(char *option) { ...@@ -501,7 +500,7 @@ parse_T_opt(char *option) {
} else if (!strncmp(option, "maxudp=", 7)) { } else if (!strncmp(option, "maxudp=", 7)) {
maxudp = atoi(option + 7); maxudp = atoi(option + 7);
} else if (!strncmp(option, "mkeytimers=", 11)) { } else if (!strncmp(option, "mkeytimers=", 11)) {
p = strtok(option + 11, "/", &last); p = strtok(option + 11, "/");
if (p == NULL) { if (p == NULL) {
ns_main_earlyfatal("bad mkeytimer"); ns_main_earlyfatal("bad mkeytimer");
} }
...@@ -511,7 +510,7 @@ parse_T_opt(char *option) { ...@@ -511,7 +510,7 @@ parse_T_opt(char *option) {
ns_main_earlyfatal("bad mkeytimer"); ns_main_earlyfatal("bad mkeytimer");
} }
p = strtok(NULL, "/", &last); p = strtok(NULL, "/");
if (p == NULL) { if (p == NULL) {
dns_zone_mkey_day = (24 * dns_zone_mkey_hour); dns_zone_mkey_day = (24 * dns_zone_mkey_hour);
dns_zone_mkey_month = (30 * dns_zone_mkey_day); dns_zone_mkey_month = (30 * dns_zone_mkey_day);
...@@ -522,7 +521,7 @@ parse_T_opt(char *option) { ...@@ -522,7 +521,7 @@ parse_T_opt(char *option) {
if (dns_zone_mkey_day < dns_zone_mkey_hour) if (dns_zone_mkey_day < dns_zone_mkey_hour)
ns_main_earlyfatal("bad mkeytimer"); ns_main_earlyfatal("bad mkeytimer");
p = strtok(NULL, "/", &last); p = strtok(NULL, "/");
if (p == NULL) { if (p == NULL) {
dns_zone_mkey_month = (30 * dns_zone_mkey_day); dns_zone_mkey_month = (30 * dns_zone_mkey_day);
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment