[PATCH evemu 5/6] Fix [-Wformat] warnings

Peter Hutterer peter.hutterer at who-t.net
Thu Nov 21 17:50:40 PST 2013


evemu.c:451:5: warning: format '%x' expects argument of type 'unsigned int *',
but argument 5 has type 'unsigned char *' [-Wformat=]

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evemu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/evemu.c b/src/evemu.c
index 2b1f085..9aa8e5e 100644
--- a/src/evemu.c
+++ b/src/evemu.c
@@ -418,7 +418,7 @@ static int parse_prop(struct evemu_device *dev, const char *line)
 	if (strlen(line) <= 2 || strncmp(line, "P:", 2) != 0)
 		return 0;
 
-	matched = sscanf(line, "P: %02x %02x %02x %02x %02x %02x %02x %02x\n",
+	matched = sscanf(line, "P: %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx\n",
 				mask + 0, mask + 1, mask + 2, mask + 3,
 				mask + 4, mask + 5, mask + 6, mask + 7);
 
@@ -446,7 +446,7 @@ static int parse_mask(struct evemu_device *dev, const char *line)
 	if (strlen(line) <= 2 || strncmp(line, "B:", 2) != 0)
 		return 0;
 
-	matched = sscanf(line, "B: %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
+	matched = sscanf(line, "B: %02x %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx\n",
 				&index, mask + 0, mask + 1, mask + 2, mask + 3,
 				mask + 4, mask + 5, mask + 6, mask + 7);
 
-- 
1.8.3.1



More information about the Input-tools mailing list