From: Lennart Poettering Date: Wed, 10 Feb 2021 21:18:52 +0000 (+0100) Subject: sd-device: don't compare pointers with numeric zero X-Git-Tag: v248-rc1~54^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96fb82aa06f2edef153c0ecb1642783aac1c1c84;p=thirdparty%2Fsystemd.git sd-device: don't compare pointers with numeric zero Our coding style says no to this. --- diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c index e37575d3b93..c39ac3f3b95 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;