]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
cmd_fuse: sanitize printf format strings for hex values
authorLothar Waßmann <LW@KARO-electronics.de>
Fri, 21 Aug 2015 13:37:22 +0000 (15:37 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 21 Aug 2015 13:37:22 +0000 (15:37 +0200)
common/cmd_fuse.c

index d4bc0f6c94a17a5e0084dc9ddd7fd5218a7badfc..4d4f77a72d2c3725c19703f2e3b4ff1e1e32735e 100644 (file)
@@ -63,13 +63,13 @@ static int do_fuse(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                printf("Reading bank %u:\n", bank);
                for (i = 0; i < cnt; i++, word++) {
                        if (!(i % 4))
-                               printf("\nWord 0x%.8x:", word);
+                               printf("\nWord 0x%08x:", word);
 
                        ret = fuse_read(bank, word, &val);
                        if (ret)
                                goto err;
 
-                       printf(" %.8x", val);
+                       printf(" %08x", val);
                }
                putc('\n');
        } else if (!strcmp(op, "sense")) {
@@ -81,13 +81,13 @@ static int do_fuse(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                printf("Sensing bank %u:\n", bank);
                for (i = 0; i < cnt; i++, word++) {
                        if (!(i % 4))
-                               printf("\nWord 0x%.8x:", word);
+                               printf("\nWord 0x%08x:", word);
 
                        ret = fuse_sense(bank, word, &val);
                        if (ret)
                                goto err;
 
-                       printf(" %.8x", val);
+                       printf(" %08x", val);
                }
                putc('\n');
        } else if (!strcmp(op, "prog")) {
@@ -98,7 +98,7 @@ static int do_fuse(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                        if (strtou32(argv[i], 16, &val))
                                return CMD_RET_USAGE;
 
-                       printf("Programming bank %u word 0x%.8x to 0x%.8x...\n",
+                       printf("Programming bank %u word 0x%08x to 0x%08x...\n",
                                        bank, word, val);
                        if (!confirmed && !confirm_prog())
                                return CMD_RET_FAILURE;
@@ -114,8 +114,8 @@ static int do_fuse(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                        if (strtou32(argv[i], 16, &val))
                                return CMD_RET_USAGE;
 
-                       printf("Overriding bank %u word 0x%.8x with "
-                                       "0x%.8x...\n", bank, word, val);
+                       printf("Overriding bank %u word 0x%08x with 0x%08x...\n",
+                               bank, word, val);
                        ret = fuse_override(bank, word, val);
                        if (ret)
                                goto err;