summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas 'Pixel' Noble <pixel@nobis-crew.org>2013-01-20 00:09:12 -0800
committerNicolas 'Pixel' Noble <pixel@nobis-crew.org>2013-01-20 00:09:12 -0800
commit71aba2fccba167f7c402f5f603e6f980b709b07e (patch)
tree303892153e72fe9873da8e73dd1218318a8f9f7a /src
parent50693a26b73bd2ad0c3d3a0854c855a6686c1344 (diff)
Fun that this was wrong all along, and that only 64 bits compilation managed to catch it.
Diffstat (limited to 'src')
-rw-r--r--src/BString.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/BString.cc b/src/BString.cc
index 74bc7d9..bf7b4e3 100644
--- a/src/BString.cc
+++ b/src/BString.cc
@@ -53,6 +53,9 @@ Balau::String & Balau::String::do_rtrim() {
unsigned int i, l = length(), p = l;
const char * buffer = data();
+ if (l == 0)
+ return *this;
+
for (i = l - 1; i > 0; i--)
if (isspace(buffer[i]))
p--;