diff options
| author | Yuichiro MASUI <[email protected]> | 2012-10-27 14:26:50 +0900 |
|---|---|---|
| committer | Yuichiro MASUI <[email protected]> | 2012-10-27 14:26:50 +0900 |
| commit | 15f46a1feba74cba4f25ec99df79a3f1e07b0b09 (patch) | |
| tree | 04bbc7fceaf3ee7ddbcfb1dfbf623aaebff720ef /src/dump.c | |
| parent | 559933f577d5073464aa06facc1b754de6225d8a (diff) | |
| download | mruby-15f46a1feba74cba4f25ec99df79a3f1e07b0b09.tar.gz mruby-15f46a1feba74cba4f25ec99df79a3f1e07b0b09.zip | |
define convert method mrb_int/mrb_float with C string
Diffstat (limited to 'src/dump.c')
| -rw-r--r-- | src/dump.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dump.c b/src/dump.c index 15e11153e..5100014d9 100644 --- a/src/dump.c +++ b/src/dump.c @@ -226,11 +226,11 @@ get_pool_block_size(mrb_state *mrb, mrb_irep *irep, int type) switch (mrb_type(irep->pool[pool_no])) { case MRB_TT_FIXNUM: - len = sprintf( buf, "%d", mrb_fixnum(irep->pool[pool_no])); + len = mrb_int_to_str( buf, mrb_fixnum(irep->pool[pool_no])); size += (uint32_t)len; break; case MRB_TT_FLOAT: - len = sprintf( buf, "%.16e", mrb_float(irep->pool[pool_no])); + len = mrb_float_to_str( buf, mrb_float(irep->pool[pool_no])); size += (uint32_t)len; break; case MRB_TT_STRING: @@ -346,11 +346,11 @@ write_pool_block(mrb_state *mrb, mrb_irep *irep, char *buf, int type) switch (mrb_type(irep->pool[pool_no])) { case MRB_TT_FIXNUM: - len = sprintf(char_buf, "%d", mrb_fixnum(irep->pool[pool_no])); + len = mrb_int_to_str(char_buf, mrb_fixnum(irep->pool[pool_no])); break; case MRB_TT_FLOAT: - len = sprintf(char_buf, "%.16e", mrb_float(irep->pool[pool_no])); + len = mrb_float_to_str(char_buf, mrb_float(irep->pool[pool_no])); break; case MRB_TT_STRING: |
