summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsdserialize.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-02-15 17:29:48 -0500
committerNat Goodspeed <nat@lindenlab.com>2023-02-15 17:29:48 -0500
commit292bb3991b589d39d61cf721b82fe7bdae460785 (patch)
treec27ca0e82409f35c3aa719e07b392d5b49a0abcd /indra/llcommon/llsdserialize.cpp
parent224667e1cc53d8b22e4b6107c3b0b274127941a7 (diff)
SL-18330: Fix per PR review comments.
Diffstat (limited to 'indra/llcommon/llsdserialize.cpp')
-rw-r--r--indra/llcommon/llsdserialize.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index 0a5e3652c7..a14a6b5b1b 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -169,9 +169,13 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, llssize max_bytes)
/*
* Remove the newline chars
*/
- auto lastchar = header.find_last_not_of("\r\n");
+ std::string::size_type lastchar = header.find_last_not_of("\r\n");
if (lastchar != std::string::npos)
{
+ // It's important that find_last_not_of() returns size_type, which is
+ // why lastchar explicitly declares the type above. erase(size_type)
+ // erases from that offset to the end of the string, whereas
+ // erase(iterator) erases only a single character.
header.erase(lastchar+1);
}