From a591dadd96a1b26469e20470e564821a38ca0b36 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Tue, 13 Oct 2020 10:28:52 +0200 Subject: [PATCH] cangw: fix sscanf() signed/unsigned warning Signed-off-by: Oliver Hartkopp --- cangw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cangw.c b/cangw.c index 0485365..d3bd282 100644 --- a/cangw.c +++ b/cangw.c @@ -295,14 +295,14 @@ int parse_crc8_profile(char *optarg, struct cgw_csum_crc8 *crc8) int ret = 1; char *ptr; - if (sscanf(optarg, "%hhd:", &crc8->profile) != 1) + if (sscanf(optarg, "%hhu:", &crc8->profile) != 1) return ret; switch (crc8->profile) { case CGW_CRC8PRF_1U8: - if (sscanf(optarg, "%hhd:%2hhx", &crc8->profile, &crc8->profile_data[0]) == 2) + if (sscanf(optarg, "%hhu:%2hhx", &crc8->profile, &crc8->profile_data[0]) == 2) ret = 0; break; @@ -770,7 +770,7 @@ int main(int argc, char **argv) break; case 'l': - if (sscanf(optarg, "%hhd", &limit_hops) != 1 || !(limit_hops)) { + if (sscanf(optarg, "%hhu", &limit_hops) != 1 || !(limit_hops)) { printf("Bad hop limit definition '%s'.\n", optarg); exit(1); }