summaryrefslogtreecommitdiffstats
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
commit891ccc9d63fc5cfc72a0447ce60ec6d175a29c33 (patch)
tree2c9a6eb924e6cca3317a2c82cb473bd36b9fda28 /string.c
parente842d4d10eb8496a3428468aaae4e1bdcc39d0ae (diff)
downloadruby-891ccc9d63fc5cfc72a0447ce60ec6d175a29c33.tar.gz
ruby-891ccc9d63fc5cfc72a0447ce60ec6d175a29c33.tar.xz
ruby-891ccc9d63fc5cfc72a0447ce60ec6d175a29c33.zip
* 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: http://svn.ruby-lang.org/repos/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 804513e4e..deab22b9e 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;