rfkill: fix compiler warning [-Wformat=]

* `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>
This commit is contained in:
Karel Zak 2021-05-06 12:24:41 +02:00
parent c8d931ebe2
commit f798aed128
1 changed files with 2 additions and 1 deletions

View 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;
}