summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-08 15:08:15 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-08 15:08:15 +0000
commitbba5e1126b62b24388a19e27f5002d15e15cdae3 (patch)
tree966cc3f6a9fc175c14a0147c138717b97cd426f7 /sprintf.c
parent7e833da5feab7c68924280e4e183784504e664ba (diff)
* io.c (rb_io_getline_fast): wrong calculation of new position
from rb_str_coderange_scan_restartable(). [ruby-core:28103] * io.c (read_all): ditto. * sprintf.c (rb_str_format): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sprintf.c b/sprintf.c
index b5cad94..bec0569 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -483,7 +483,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
for (t = p; t < end && *t != '%'; t++) ;
PUSH(p, t - p);
if (coderange != ENC_CODERANGE_BROKEN && scanned < blen) {
- scanned = rb_str_coderange_scan_restartable(buf+scanned, buf+blen, enc, &coderange);
+ scanned += rb_str_coderange_scan_restartable(buf+scanned, buf+blen, enc, &coderange);
ENC_CODERANGE_SET(result, coderange);
}
if (t >= end) {
@@ -672,7 +672,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
rb_str_set_len(result, blen);
if (coderange != ENC_CODERANGE_BROKEN && scanned < blen) {
int cr = coderange;
- scanned = rb_str_coderange_scan_restartable(buf+scanned, buf+blen, enc, &cr);
+ scanned += rb_str_coderange_scan_restartable(buf+scanned, buf+blen, enc, &cr);
ENC_CODERANGE_SET(result,
(cr == ENC_CODERANGE_UNKNOWN ?
ENC_CODERANGE_BROKEN : (coderange = cr)));