From 96fb82aa06f2edef153c0ecb1642783aac1c1c84 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 10 Feb 2021 22:18:52 +0100 Subject: [PATCH] sd-device: don't compare pointers with numeric zero Our coding style says no to this. --- src/libsystemd/sd-device/device-private.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; -- 2.47.3