diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-11-16 14:42:14 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-16 16:05:29 +0100 |
commit | f20db199541ea35c65edfeed9e5401cab6fe6bac (patch) | |
tree | 0c697e7e98ceb7e48a7776a401e2229a25aa6ee2 /src/resolve | |
parent | tests: run fuzzers four times in a row (#10794) (diff) | |
download | systemd-f20db199541ea35c65edfeed9e5401cab6fe6bac.tar.xz systemd-f20db199541ea35c65edfeed9e5401cab6fe6bac.zip |
cocci: simplify some if checks
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/resolved-dns-dnssec.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/resolve/resolved-dns-dnssec.c b/src/resolve/resolved-dns-dnssec.c index 86a9a58c5b..a837414ca1 100644 --- a/src/resolve/resolved-dns-dnssec.c +++ b/src/resolve/resolved-dns-dnssec.c @@ -1378,17 +1378,13 @@ static int nsec3_is_good(DnsResourceRecord *rr, DnsResourceRecord *nsec3) { a = dns_resource_key_name(rr->key); r = dns_name_parent(&a); /* strip off hash */ - if (r < 0) + if (r <= 0) return r; - if (r == 0) - return 0; b = dns_resource_key_name(nsec3->key); r = dns_name_parent(&b); /* strip off hash */ - if (r < 0) + if (r <= 0) return r; - if (r == 0) - return 0; /* Make sure both have the same parent */ return dns_name_equal(a, b); @@ -2096,10 +2092,8 @@ static int dnssec_test_positive_wildcard_nsec3( for (;;) { next_closer = name; r = dns_name_parent(&name); - if (r < 0) + if (r <= 0) return r; - if (r == 0) - return 0; r = dns_name_equal(name, source); if (r < 0) |