diff options
| author | Mae Dartmann <hello@maedartmann.name> | 2022-05-12 12:08:18 +0200 |
|---|---|---|
| committer | Mae Dartmann <hello@maedartmann.name> | 2022-05-12 12:08:18 +0200 |
| commit | a6caac2b61de0f1edfc2db1ec695218e4c8be7ea (patch) | |
| tree | b10f9bc8d801acd8de7ba4e64b62663b6f7f7c59 /src/helpers/MiscFunctions.cpp | |
| parent | ac7903f5217baa1a784341390c2848edbca33ccf (diff) | |
Fix string underflow in removeBeginEndSpacesTabs()
Signed-off-by: Mae Dartmann <hello@maedartmann.name>
Changes to be committed:
modified: src/helpers/MiscFunctions.cpp
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
| -rw-r--r-- | src/helpers/MiscFunctions.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index bf8724c6..61ae0c49 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -69,7 +69,7 @@ std::string removeBeginEndSpacesTabs(std::string str) { str = str.substr(1); } - while (str[str.length() - 1] == ' ' || str[str.length() - 1] == '\t') { + while (str.length() != 0 && (str[str.length() - 1] == ' ' || str[str.length() - 1] == '\t')) { str = str.substr(0, str.length() - 1); } |
