From b1afcbbdcaf1c7b485e4e9273ff0d09580ff20df Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 1 Aug 2014 08:57:17 -0400 Subject: [PATCH 22/22] Fix some minor errors cppcheck found. Signed-off-by: Peter Jones --- src/efibootmgr/efibootmgr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c index 40be505..5af2cad 100644 --- a/src/efibootmgr/efibootmgr.c +++ b/src/efibootmgr/efibootmgr.c @@ -933,7 +933,8 @@ set_default_opts() static void parse_opts(int argc, char **argv) { - int c, num, rc; + int c, rc; + unsigned int num; int option_index = 0; while (1) @@ -1015,7 +1016,7 @@ parse_opts(int argc, char **argv) opts.disk = optarg; break; case 'e': - rc = sscanf(optarg, "%d", &num); + rc = sscanf(optarg, "%u", &num); if (rc == 1) opts.edd_version = num; else { fprintf (stderr,"invalid numeric value %s\n",optarg); @@ -1118,7 +1119,7 @@ parse_opts(int argc, char **argv) if (optarg) { if (!strcmp(optarg, "v")) opts.verbose = 2; if (!strcmp(optarg, "vv")) opts.verbose = 3; - rc = sscanf(optarg, "%d", &num); + rc = sscanf(optarg, "%u", &num); if (rc == 1) opts.verbose = num; else { fprintf (stderr,"invalid numeric value %s\n",optarg); -- 1.9.3