summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-06-26 13:57:31 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-06-26 13:57:31 -0700
commitcf8b6ec8418ce3970a82b80d514a17b0ffa61b53 (patch)
treea1a23c7ed786af0a7d2777d015a6e7a0bfe6aff5
parente32ab50eaf658d9f59b3bfb0edd7275fc0f456d4 (diff)
parent0b4d96741baaf610edd23207838726517ddecbb5 (diff)
downloadmruby-cf8b6ec8418ce3970a82b80d514a17b0ffa61b53.tar.gz
mruby-cf8b6ec8418ce3970a82b80d514a17b0ffa61b53.zip
Merge pull request #326 from masamitsu-murase/modify_str_format_len
Fix str_format_len.
-rw-r--r--src/cdump.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cdump.c b/src/cdump.c
index fedfd9c2b..0df2bb491 100644
--- a/src/cdump.c
+++ b/src/cdump.c
@@ -45,7 +45,7 @@ str_format_len(mrb_value str)
char *src;
- for (src = RSTRING_PTR(str); src < RSTRING_END(str);) {
+ for (src = RSTRING_PTR(str); src < RSTRING_END(str); src++) {
switch (*src) {
case 0x07:/* BEL */ /* fall through */
case 0x08:/* BS */ /* fall through */
@@ -58,11 +58,11 @@ str_format_len(mrb_value str)
case 0x27:/* ' */ /* fall through */
case 0x3F:/* ? */ /* fall through */
case 0x5C:/* \ */ /* fall through */
- dump_len += 2; src += 2;
+ dump_len += 2;
break;
default:
- dump_len++; src++;
+ dump_len++;
break;
}
}