From 087f010ddbbfaf6f16a18c4ab00500005b633d8d Mon Sep 17 00:00:00 2001 From: eban Date: Tue, 27 Aug 2002 10:24:24 +0000 Subject: * string.c (rb_str_rstrip_bang): don't access address -1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index a4f597f2a4..49b0c7add7 100644 --- a/string.c +++ b/string.c @@ -2828,9 +2828,7 @@ rb_str_rstrip_bang(str) e = t = s + RSTRING(str)->len; /* remove trailing spaces */ - t--; - while (s <= t && ISSPACE(*t)) t--; - t++; + while (s < t && ISSPACE(*(t-1))) t--; RSTRING(str)->len = t-s; if (t < e) { -- cgit v1.2.3