From e76705904d4fa78c9ee93ba5bd652417527257fb Mon Sep 17 00:00:00 2001 From: Jeremy Nimmer Date: Mon, 6 Jan 2025 14:00:07 -0800 Subject: [PATCH] [yaml] Hotfix for binary decoding error message --- common/yaml/yaml_read_archive.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/yaml/yaml_read_archive.cc b/common/yaml/yaml_read_archive.cc index 0ec905d0f273..eabe250713d6 100644 --- a/common/yaml/yaml_read_archive.cc +++ b/common/yaml/yaml_read_archive.cc @@ -316,7 +316,7 @@ void YamlReadArchive::ParseScalar(const internal::Node& scalar, // result. If necessary, we can attempt stripping whitespace from encoded. // Grab the leading snippet of encoded text for the error message. - const std::string_view head = encoded.substr(0, 25); + const std::string_view head = std::string_view{encoded}.substr(0, 25); ReportError(fmt::format("contains invalid base64 text '{}{}'", head, head.size() < encoded.size() ? "..." : "")); return;