summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2019-09-19 20:45:24 +0900
committerNARUSE, Yui <naruse@airemix.jp>2019-09-19 20:45:24 +0900
commitcbf405fec4ea3c93640b0b7072cf6205442100e5 (patch)
treec0c47e9467bb708666f3e6c4bf4d7fec0e6808a1 /time.c
parent5208c431bef3240eb251f5da23723b324431a98e (diff)
Specify encoding explicitly for sprintf
Diffstat (limited to 'time.c')
-rw-r--r--time.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/time.c b/time.c
index a067fa4ef5..70cac06766 100644
--- a/time.c
+++ b/time.c
@@ -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);