diff --git a/src/lib/core/TLVReader.cpp b/src/lib/core/TLVReader.cpp index c4537f945f97f3..335e44b457f6f1 100644 --- a/src/lib/core/TLVReader.cpp +++ b/src/lib/core/TLVReader.cpp @@ -314,10 +314,10 @@ CHIP_ERROR TLVReader::Get(CharSpan & v) // If Unicode Information Separator 1 (0x1f) is present in the string then method returns // string ending at first appearance of the Information Separator 1. - const uint8_t * unitSeparator = reinterpret_cast(memchr(bytes, kUnicodeInformationSeparator1, len)); - if (unitSeparator != nullptr) + const uint8_t * infoSeparator = reinterpret_cast(memchr(bytes, kUnicodeInformationSeparator1, len)); + if (infoSeparator != nullptr) { - len = static_cast(unitSeparator - bytes); + len = static_cast(infoSeparator - bytes); } v = CharSpan(Uint8::to_const_char(bytes), len);