From 891ccc9d63fc5cfc72a0447ce60ec6d175a29c33 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 9 Dec 2009 00:50:37 +0000 Subject: * 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 --- string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string.c') 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; -- cgit