From 6b0f90c321201e80c23298bfd5f522233b5a7c20 Mon Sep 17 00:00:00 2001 From: Kyle Reed <3761006+kallanreed@users.noreply.github.com> Date: Fri, 23 Jun 2023 15:08:11 -0700 Subject: [PATCH] Update string_format.cpp (#1184) --- firmware/application/string_format.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/application/string_format.cpp b/firmware/application/string_format.cpp index 30747d739..c6e999c36 100644 --- a/firmware/application/string_format.cpp +++ b/firmware/application/string_format.cpp @@ -286,7 +286,7 @@ static const char* whitespace_str = " \t\r\n"; std::string trim(std::string_view str) { auto first = str.find_first_not_of(whitespace_str); auto last = str.find_last_not_of(whitespace_str); - return std::string{str.substr(first, last - first)}; + return std::string{str.substr(first, last - first + 1)}; } std::string trimr(std::string_view str) { @@ -296,4 +296,4 @@ std::string trimr(std::string_view str) { std::string truncate(std::string_view str, size_t length) { return std::string{str.length() <= length ? str : str.substr(0, length)}; -} \ No newline at end of file +}