commit 9b864b298d564e4bd6cafc2a1cece0c6e22e284e
parent 500c08718a54bd3c3c401869fd6ad726642298c2
Author: Frederic Cambus <fred@statdns.com>
Date: Tue, 30 Mar 2021 21:16:23 +0200
Use std::basic_string::compare instead of strncmp(3).
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/statzone.cpp b/src/statzone.cpp
@@ -187,14 +187,12 @@ main(int argc, char *argv[])
if (!strcmp(token_lc, "ns")) {
results.ns++;
- if (previous_domain.empty() ||
- previous_domain.length() != domain.length() ||
- strncmp(domain.c_str(), previous_domain.c_str(), domain.length())) {
+ if (domain.compare(previous_domain)) {
results.domains++;
previous_domain = domain;
- if (!strncmp(domain.c_str(), "xn--", 4))
+ if (!domain.compare(0, 4, "xn--"))
results.idn++;
}