summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-26 09:09:41 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-26 09:09:41 +0000
commitfbbd5539ae0959e888b651039ea36caf5e4e061c (patch)
treeb3d63be30753a247585f8dacd12200e1e2cea1ea /string.c
parentcdde29b924f3f310382d059938b0c94e209fced7 (diff)
1.1b9_05_pre1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/string.c b/string.c
index 6a1165ce1ed..e8a87fd2a42 100644
--- a/string.c
+++ b/string.c
@@ -1270,16 +1270,16 @@ static VALUE
str_reverse_bang(str)
VALUE str;
{
- UCHAR *s, *e, *p;
+ UCHAR *s, *e, *p, *q;
s = RSTRING(str)->ptr;
e = s + RSTRING(str)->len - 1;
- p = ALLOCA_N(char, RSTRING(str)->len);
+ p = q = ALLOCA_N(char, RSTRING(str)->len);
while (e >= s) {
*p++ = *e--;
}
- MEMCPY(RSTRING(str)->ptr, p, char, RSTRING(str)->len);
+ MEMCPY(RSTRING(str)->ptr, q, char, RSTRING(str)->len);
return str;
}