diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-10-28 10:45:43 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-10-28 10:45:43 -0700 |
| commit | c6c4da8c484e0e3ba748806b6616ca165fafe562 (patch) | |
| tree | d107739348c6be69a84c68efe8efe28f888385c7 /src/dump.c | |
| parent | d7d5c15b54e764497aa69667d3e5d849469eb373 (diff) | |
| parent | 15f46a1feba74cba4f25ec99df79a3f1e07b0b09 (diff) | |
| download | mruby-c6c4da8c484e0e3ba748806b6616ca165fafe562.tar.gz mruby-c6c4da8c484e0e3ba748806b6616ca165fafe562.zip | |
Merge pull request #510 from masuidrive/master
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: |
