diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2019-09-19 20:45:24 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2019-09-19 20:45:24 +0900 |
commit | cbf405fec4ea3c93640b0b7072cf6205442100e5 (patch) | |
tree | c0c47e9467bb708666f3e6c4bf4d7fec0e6808a1 /time.c | |
parent | 5208c431bef3240eb251f5da23723b324431a98e (diff) | |
download | ruby-cbf405fec4ea3c93640b0b7072cf6205442100e5.tar.gz |
Specify encoding explicitly for sprintf
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4108,7 +4108,7 @@ time_inspect(VALUE time) } else if (FIXNUM_P(subsec) && FIX2LONG(subsec) < TIME_SCALE) { long len; - str = rb_sprintf("%"PRIsVALUE".%09ld", str, FIX2LONG(subsec)); + str = rb_enc_sprintf(rb_usascii_encoding(), "%"PRIsVALUE".%09ld", str, FIX2LONG(subsec)); for (len=RSTRING_LEN(str); RSTRING_PTR(str)[len-1] == '0' && len > 0; len--) ; rb_str_resize(str, len); |