Commit d51a3ca5 authored by Mark Andrews's avatar Mark Andrews

remove spurious newline in 'nameserver is a CNAME 'target'' string which broke...

remove spurious newline in 'nameserver is a CNAME 'target'' string which broke json, add missing space
parent e8d7f659
Pipeline #8642 passed with stages
in 1 minute and 54 seconds
...@@ -899,8 +899,9 @@ emiterr(const char *zone, const char *ns, const char *str) { ...@@ -899,8 +899,9 @@ emiterr(const char *zone, const char *ns, const char *str) {
jsonadd(&jdata, "\"", &jdata_len); jsonadd(&jdata, "\"", &jdata_len);
} }
jsonsafe(str, safe, sizeof(safe));
jsonadd(&jdata, ", \"error\": \"", &jdata_len); jsonadd(&jdata, ", \"error\": \"", &jdata_len);
jsonadd(&jdata, str, &jdata_len); jsonadd(&jdata, safe, &jdata_len);
jsonadd(&jdata, "\" }", &jdata_len); jsonadd(&jdata, "\" }", &jdata_len);
} else { } else {
printf("%s.%s%s: %s\n", printf("%s.%s%s: %s\n",
...@@ -931,7 +932,8 @@ printandfree(struct summary *summary) { ...@@ -931,7 +932,8 @@ printandfree(struct summary *summary) {
if ((summary->type == ns_t_a || summary->type == ns_t_aaaa) && if ((summary->type == ns_t_a || summary->type == ns_t_aaaa) &&
summary->nxdomaina && summary->nxdomainaaaa) { summary->nxdomaina && summary->nxdomainaaaa) {
emiterr(summary->zone, summary->ns, "no address records found (NXDOMAIN)"); emiterr(summary->zone, summary->ns,
"no address records found (NXDOMAIN)");
freesummary(summary); freesummary(summary);
return; return;
} }
...@@ -945,7 +947,7 @@ printandfree(struct summary *summary) { ...@@ -945,7 +947,7 @@ printandfree(struct summary *summary) {
if ((summary->type == ns_t_a || summary->type == ns_t_aaaa) && if ((summary->type == ns_t_a || summary->type == ns_t_aaaa) &&
(summary->cnamea || summary->cnameaaaa)) { (summary->cnamea || summary->cnameaaaa)) {
snprintf(buf, sizeof(buf), "nameserver is a CNAME%s%s%s\n", snprintf(buf, sizeof(buf), "nameserver is a CNAME%s%s%s",
summary->targetok ? " '": "", summary->targetok ? " '": "",
summary->targetok ? summary->target : "", summary->targetok ? summary->target : "",
summary->targetok ? "'" : ""); summary->targetok ? "'" : "");
......
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