summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-09 00:50:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-09 00:50:37 +0000
commitc9c095fc7b56c40e4857c1554932a078eb7a316e (patch)
tree2c9a6eb924e6cca3317a2c82cb473bd36b9fda28 /string.c
parent0f406d278fce4909940ed52df2009b18fee2c22a (diff)
* string.c (rb_str_justify): fixed the case a fill size is a
multiple of the length of the padding. [ruby-dev:39856] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index 804513e4ef..deab22b9e7 100644
--- a/string.c
+++ b/string.c
@@ -6635,7 +6635,7 @@ rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag)
p += llen;
}
else {
- while (llen > fclen) {
+ while (llen >= fclen) {
memcpy(p,f,flen);
p += flen;
llen -= fclen;
@@ -6652,7 +6652,7 @@ rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag)
p += rlen;
}
else {
- while (rlen > fclen) {
+ while (rlen >= fclen) {
memcpy(p,f,flen);
p += flen;
rlen -= fclen;