diff --git a/BSP/u-boot/board/novatek/nvt-na51089/na51089evb.c b/BSP/u-boot/board/novatek/nvt-na51089/na51089evb.c index beebcb829..1ae1041f4 100755 --- a/BSP/u-boot/board/novatek/nvt-na51089/na51089evb.c +++ b/BSP/u-boot/board/novatek/nvt-na51089/na51089evb.c @@ -155,7 +155,7 @@ static int nvt_handle_fw_abin(void) { int ret = 0; char cmdline[1024] = {0}; - char buf[1024] = {0}; + char buf[512] = {0}; int ota_upgrade_sts = 0; int is_ota = 0; if(WDT_OTA_GET_STS() == WDT_OTA_MAKEFOURCC(WDT_OTA_STS_LOADER_DETECTING_FW)) @@ -216,21 +216,27 @@ static int nvt_handle_fw_abin(void) } } else{ printf("%s%s:%d Update successfully %s\r\n", ANSI_COLOR_YELLOW, __FUNCTION__, __LINE__, ANSI_COLOR_RESET); - ota_upgrade_sts = 1; if(is_ota) WDT_OTA_SET_STS(WDT_OTA_STS_UBOOT_UPDATE_OK); + + ota_upgrade_sts = 1; } /* * To handle bootargs expanding for the kernel /proc/cmdline and uboot mtdids env setting */ - sprintf(buf,"%s ",env_get("bootargs")); + //printf("%s:%d ota_upgrade_sts:%d\n", __FUNCTION__, __LINE__ ,ota_upgrade_sts); + + snprintf(buf, sizeof(buf), env_get("bootargs")); + //sprintf(buf,"%s ",env_get("bootargs")); + //printf("%s:%d ota_upgrade_sts:%d\n", __FUNCTION__, __LINE__ ,ota_upgrade_sts); + strcat(cmdline, buf); ret = nvt_part_config((char *)cmdline, NULL); if (ret < 0) return ret; - if (ota_upgrade_sts == 1) { + if (ota_upgrade_sts != 0) { strcat(cmdline, "ota_flag=0x1"); }