1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-14 19:24:13 +03:00

sd-device: don't compare pointers with numeric zero

Our coding style says no to this.
This commit is contained in:
Lennart Poettering 2021-02-10 22:18:52 +01:00
parent 5f94d96c47
commit 96fb82aa06

View File

@ -355,7 +355,12 @@ static int device_amend(sd_device *device, const char *key, const char *value) {
return 0; 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; const char *major = NULL, *minor = NULL;
char *value; char *value;
int r; int r;
@ -384,10 +389,10 @@ static int device_append(sd_device *device, char *key, const char **_major, cons
return r; return r;
} }
if (major != 0) if (major)
*_major = major; *_major = major;
if (minor != 0) if (minor)
*_minor = minor; *_minor = minor;
return 0; return 0;