From fb934486f5bc70bcd838cf694fc45614c7220167 Mon Sep 17 00:00:00 2001 From: nan-xiansen Date: Wed, 7 Dec 2022 11:31:16 +0800 Subject: [PATCH] =?UTF-8?q?fixed=2098f6c89=20from=20https://gitee.com/nan-?= =?UTF-8?q?xiansen/xts=5Facts/pulls/6811=20=E3=80=90startup=5Flite?= =?UTF-8?q?=E3=80=91=E7=94=A8=E4=BE=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nan-xiansen Change-Id: Ia78e19fdfa5dc83147ae4cbc646d415b6623af64 --- startup_lite/syspara_hal/src/deviceinfo_func_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startup_lite/syspara_hal/src/deviceinfo_func_test.c b/startup_lite/syspara_hal/src/deviceinfo_func_test.c index dcd7b3aef..aa1004b7c 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); -- GitLab