mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-06 23:10:03 +02:00
cangw: fix sscanf() signed/unsigned warning
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
@@ -295,14 +295,14 @@ int parse_crc8_profile(char *optarg, struct cgw_csum_crc8 *crc8)
|
|||||||
int ret = 1;
|
int ret = 1;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
if (sscanf(optarg, "%hhd:", &crc8->profile) != 1)
|
if (sscanf(optarg, "%hhu:", &crc8->profile) != 1)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
switch (crc8->profile) {
|
switch (crc8->profile) {
|
||||||
|
|
||||||
case CGW_CRC8PRF_1U8:
|
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;
|
ret = 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -770,7 +770,7 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'l':
|
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);
|
printf("Bad hop limit definition '%s'.\n", optarg);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user