From f7789d811f60b89dcecf308a0e6fe8b568bd3100 Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Fri, 23 Sep 2022 13:55:33 +0800 Subject: [PATCH] [Ameba] Fix Trailing Null * TC-BINFO-2.1 when reading location, it shows 3 chars. Remove trailing null after getPref_str_new --- src/platform/Ameba/AmebaConfig.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/Ameba/AmebaConfig.cpp b/src/platform/Ameba/AmebaConfig.cpp index 5c22877c603b87..cd03445fd0f63c 100644 --- a/src/platform/Ameba/AmebaConfig.cpp +++ b/src/platform/Ameba/AmebaConfig.cpp @@ -152,6 +152,7 @@ CHIP_ERROR AmebaConfig::ReadConfigValueStr(Key key, char * buf, size_t bufSize, if (success == 0) { + outLen -= 1; // Don't count trailing null return CHIP_NO_ERROR; } else