From eec45a93effe69a821960839760b9e39be1ebc63 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 24 Jul 2021 14:24:18 +0900 Subject: Escape unprintable chars only, without surrounding quotes --- sprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sprintf.c') diff --git a/sprintf.c b/sprintf.c index f54336fca5..693b30bd8b 100644 --- a/sprintf.c +++ b/sprintf.c @@ -1121,7 +1121,7 @@ ruby__sfvextra(rb_printf_buffer *fp, size_t valsize, void *valp, long *sz, int s else if (SYMBOL_P(value)) { value = rb_sym2str(value); if (sign == ' ' && !rb_str_symname_p(value)) { - value = rb_str_inspect(value); + value = rb_str_escape(value); } } else { -- cgit v1.2.1