]> git.sur5r.net Git - u-boot/blobdiff - board/keymile/common/common.c
Fix GCC format-security errors and convert sprintfs.
[u-boot] / board / keymile / common / common.c
index 2ddb3da38f35f7245551bd66ebbffabd71f59420..a42f3eca33b3f22b1721879da42116d03b9f7d99 100644 (file)
@@ -168,7 +168,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
                printf("can't get the IVM_Boardid\n");
                return 1;
        }
-       sprintf((char *)buf, "%s", p);
+       strcpy((char *)buf, p);
        setenv("boardid", (char *)buf);
        printf("set boardid=%s\n", buf);
 
@@ -177,7 +177,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
                printf("can't get the IVM_HWKey\n");
                return 1;
        }
-       sprintf((char *)buf, "%s", p);
+       strcpy((char *)buf, p);
        setenv("hwkey", (char *)buf);
        printf("set hwkey=%s\n", buf);
        printf("Execute manually saveenv for persistent storage.\n");
@@ -354,12 +354,16 @@ static int do_checktestboot(cmd_tbl_t *cmdtp, int flag, int argc,
 
 #if defined(CONFIG_POST)
        testpin = post_hotkeys_pressed();
-       s = getenv("test_bank");
 #endif
+#if defined(CONFIG_MGCOGE3NE)
+       testpin = get_testpin();
+#endif
+       s = getenv("test_bank");
        /* when test_bank is not set, act as if testpin is not asserted */
        testboot = (testpin != 0) && (s);
        if (verbose) {
                printf("testpin   = %d\n", testpin);
+               /* cppcheck-suppress nullPointer */
                printf("test_bank = %s\n", s ? s : "not set");
                printf("boot test app : %s\n", (testboot) ? "yes" : "no");
        }