]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
rfkill: fix compiler warning [-Wformat=]
authorKarel Zak <kzak@redhat.com>
Thu, 6 May 2021 10:24:41 +0000 (12:24 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 May 2021 10:25:10 +0000 (12:25 +0200)
* `RFKILL_EVENT_SIZE_V1` is defined as sizeof(struct rfkill_event), so let's use %zu

* cast `len` to size_t to make it usable with %zu

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/rfkill.c

index 542614b1bae44a12fd3e9afd22ee9c8bf1401a80..0b72fa96384ba29a9e82b00bff50acf62bf222c4 100644 (file)
@@ -218,7 +218,8 @@ static int rfkill_read_event(int fd, struct rfkill_event *event)
        }
 
        if (len < RFKILL_EVENT_SIZE_V1) {
-               warnx(_("wrong size of rfkill event: %zu < %d"), len, RFKILL_EVENT_SIZE_V1);
+               warnx(_("wrong size of rfkill event: %zu < %zu"),
+                               (size_t) len, RFKILL_EVENT_SIZE_V1);
                return 1;
        }