Skip to content

Commit 8a45fe7

Browse files
sravnborgmasahir0y
authored andcommitted
samples: uhid: fix warnings in uhid-example
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 <sam@ravnborg.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent e079a08 commit 8a45fe7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎samples/uhid/uhid-example.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static int uhid_write(int fd, const struct uhid_event *ev)
165165
fprintf(stderr, "Cannot write to uhid: %m\n");
166166
return -errno;
167167
} else if (ret != sizeof(*ev)) {
168-
fprintf(stderr, "Wrong size written to uhid: %ld != %lu\n",
168+
fprintf(stderr, "Wrong size written to uhid: %zd != %zu\n",
169169
ret, sizeof(ev));
170170
return -EFAULT;
171171
} else {
@@ -236,7 +236,7 @@ static int event(int fd)
236236
fprintf(stderr, "Cannot read uhid-cdev: %m\n");
237237
return -errno;
238238
} else if (ret != sizeof(ev)) {
239-
fprintf(stderr, "Invalid size read from uhid-dev: %ld != %lu\n",
239+
fprintf(stderr, "Invalid size read from uhid-dev: %zd != %zu\n",
240240
ret, sizeof(ev));
241241
return -EFAULT;
242242
}

0 commit comments

Comments
 (0)