From 71aba2fccba167f7c402f5f603e6f980b709b07e Mon Sep 17 00:00:00 2001 From: Nicolas 'Pixel' Noble Date: Sun, 20 Jan 2013 00:09:12 -0800 Subject: Fun that this was wrong all along, and that only 64 bits compilation managed to catch it. --- src/BString.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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--; -- cgit v1.2.3