Skip to content

Commit

Permalink
Add Reset() calls to have clean names and error text (#28066)
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored and pull[bot] committed Jul 8, 2024
1 parent 863a263 commit 2072162
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/format/protocol_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ void PayloadDecoderBase::ExitContainer(PayloadEntry & entry)
CHIP_ERROR err = mReader.ExitContainer(mNestingEnters[--mCurrentNesting]);
if (err != CHIP_NO_ERROR)
{
mValueBuilder.AddFormat("ERROR: %" CHIP_ERROR_FORMAT, err.Format());
mNameBuilder.AddFormat("END CONTAINER");
mValueBuilder.Reset().AddFormat("ERROR: %" CHIP_ERROR_FORMAT, err.Format());
mNameBuilder.Reset().AddFormat("END CONTAINER");
entry = PayloadEntry::SimpleValue(mNameBuilder.c_str(), mValueBuilder.c_str());
mState = State::kDone;
return;
Expand Down

0 comments on commit 2072162

Please sign in to comment.