diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-02-10 22:18:52 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-02-18 18:20:09 +0100 |
commit | 96fb82aa06f2edef153c0ecb1642783aac1c1c84 (patch) | |
tree | 9d2d9b563e861a89c0aff20c5942849c47aac382 /src | |
parent | Merge pull request #18667 from poettering/resolved-change-notification (diff) | |
download | systemd-96fb82aa06f2edef153c0ecb1642783aac1c1c84.tar.xz systemd-96fb82aa06f2edef153c0ecb1642783aac1c1c84.zip |
sd-device: don't compare pointers with numeric zero
Our coding style says no to this.
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd/sd-device/device-private.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c index e37575d3b9..c39ac3f3b9 100644 --- a/src/libsystemd/sd-device/device-private.c +++ b/src/libsystemd/sd-device/device-private.c @@ -355,7 +355,12 @@ static int device_amend(sd_device *device, const char *key, const char *value) { return 0; } -static int device_append(sd_device *device, char *key, const char **_major, const char **_minor) { +static int device_append( + sd_device *device, + char *key, + const char **_major, + const char **_minor) { + const char *major = NULL, *minor = NULL; char *value; int r; @@ -384,10 +389,10 @@ static int device_append(sd_device *device, char *key, const char **_major, cons return r; } - if (major != 0) + if (major) *_major = major; - if (minor != 0) + if (minor) *_minor = minor; return 0; |