From 47448899e3836cbc48688f3f5c84054d33307643 Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Thu, 10 Nov 2022 18:14:24 +0800 Subject: [PATCH] [Ameba] Fix Trailing Null (#23485) * 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 b9ac5d05b789f2..8cc287585ddc6a 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