Skip to content

Commit

Permalink
samples: uhid: fix warnings in uhid-example
Browse files Browse the repository at this point in the history
Fix warnings seen when building for 32-bit architecture.

Use "%xd" for arguments of type size_t to fix the warnings.

Signed-off-by: Sam Ravnborg <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
sravnborg authored and masahir0y committed May 17, 2020
1 parent e079a08 commit 8a45fe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/uhid/uhid-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static int uhid_write(int fd, const struct uhid_event *ev)
fprintf(stderr, "Cannot write to uhid: %m\n");
return -errno;
} else if (ret != sizeof(*ev)) {
fprintf(stderr, "Wrong size written to uhid: %ld != %lu\n",
fprintf(stderr, "Wrong size written to uhid: %zd != %zu\n",
ret, sizeof(ev));
return -EFAULT;
} else {
Expand Down Expand Up @@ -236,7 +236,7 @@ static int event(int fd)
fprintf(stderr, "Cannot read uhid-cdev: %m\n");
return -errno;
} else if (ret != sizeof(ev)) {
fprintf(stderr, "Invalid size read from uhid-dev: %ld != %lu\n",
fprintf(stderr, "Invalid size read from uhid-dev: %zd != %zu\n",
ret, sizeof(ev));
return -EFAULT;
}
Expand Down

0 comments on commit 8a45fe7

Please sign in to comment.