summaryrefslogtreecommitdiff
path: root/src/systemd/src/basic/ether-addr-util.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-12-13 09:12:31 +0100
committerThomas Haller <thaller@redhat.com>2017-12-13 10:41:18 +0100
commit8c0dfd718883d3e6bc510cf4105c136f345755f4 (patch)
tree8108c243d5b7afc13e0680947b082c40c2747517 /src/systemd/src/basic/ether-addr-util.c
parent2fb7479e82a07dfb8dcd094507eb4f1be1cd62cd (diff)
parentac29b8cf8a6162332b7db9f6a408f0a1ae7ce1d3 (diff)
systemd: merge branch systemd into master
Systemd instroduces a macro _fallthrough_, see https://github.com/systemd/systemd/pull/7389. However, it does not yet seem conclusive how to handle this properly in ever situation. While shared/nm-utils/siphash24.c makes use of the new macro, don't do that in our fork. siphash24.h does not include all systemd headers, hence _fallthrough_ is not defined. We could re-implement it as _nm_fallthrough, but given the open questions, that doesn't seem the
Diffstat (limited to 'src/systemd/src/basic/ether-addr-util.c')
-rw-r--r--src/systemd/src/basic/ether-addr-util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/systemd/src/basic/ether-addr-util.c b/src/systemd/src/basic/ether-addr-util.c
index a793219cc2..dad3e6285a 100644
--- a/src/systemd/src/basic/ether-addr-util.c
+++ b/src/systemd/src/basic/ether-addr-util.c
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
/***
This file is part of systemd.
@@ -72,7 +73,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; \
@@ -100,7 +101,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 == '.') {