diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-08 20:52:38 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-12-11 16:05:40 +0100 |
commit | 234519ae6d6821ae5e83bcddb211905ef4de5700 (patch) | |
tree | 5335ad6ea093f0829bb871c2cbf83b354e53d402 /src/basic/ether-addr-util.c | |
parent | 4a0e9289bf443fec9fc56af25f90e2a100ba7a41 (diff) | |
download | systemd-234519ae6d6821ae5e83bcddb211905ef4de5700.tar.gz |
tree-wide: drop a few == NULL and != NULL comparison
Our CODING_STYLE suggests not comparing with NULL, but relying on C's
downgrade-to-bool feature for that. Fix up some code to match these
guidelines. (This is not comprehensive, the coccinelle output for this
is unfortunately kinda borked)
Diffstat (limited to 'src/basic/ether-addr-util.c')
-rw-r--r-- | src/basic/ether-addr-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/ether-addr-util.c b/src/basic/ether-addr-util.c index d94bdbd149..bbe8bf0006 100644 --- a/src/basic/ether-addr-util.c +++ b/src/basic/ether-addr-util.c @@ -71,7 +71,7 @@ int ether_addr_from_string(const char *s, struct ether_addr *ret, size_t *offset if (s[pos] == '\0') \ break; \ hexoff = strchr(hex, s[pos]); \ - if (hexoff == NULL) \ + if (!hexoff) \ break; \ assert(hexoff >= hex); \ x = hexoff - hex; \ @@ -99,7 +99,7 @@ int ether_addr_from_string(const char *s, struct ether_addr *ret, size_t *offset sep = s[strspn(s, hex)]; if (sep == '\n') return -EINVAL; - if (strchr(":.-", sep) == NULL) + if (!strchr(":.-", sep)) return -EINVAL; if (sep == '.') { |