diff --git a/startup_lite/syspara_hal/src/deviceinfo_func_test.c b/startup_lite/syspara_hal/src/deviceinfo_func_test.c index dcd7b3aeff432aa7d8ce068769afc8f7093fdeef..aa1004b7c8e6f667eee2bcf7345df14f10a6c678 100644 --- a/startup_lite/syspara_hal/src/deviceinfo_func_test.c +++ b/startup_lite/syspara_hal/src/deviceinfo_func_test.c @@ -477,7 +477,7 @@ LITE_TEST_CASE(DeviceInfoFuncTestSuite, TEST_ASSERT_TRUE(day <= 31 && day > 0); char str[10] = {0}; - ret = sprintf_s(str, strlen(str), "%d-%02d-%02d", year, month, day); + ret = sprintf_s(str, sizeof(str) + 1, "%d-%02d-%02d", year, month, day); if (ret < RET_SUCCESS) { TEST_ASSERT_TRUE(ret >= 0);