diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-10-31 00:56:42 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-10-31 00:56:42 +0900 |
commit | 2ab247d217c7bc312c3bcbb74636a60328f64109 (patch) | |
tree | e392512deea7280dba75410e6e7363daf19b569e | |
parent | 7bf3d9343fc9ca34124026cb3806107a3a6ddf09 (diff) | |
download | ruby-2ab247d217c7bc312c3bcbb74636a60328f64109.tar.gz |
Missing format string
Do not use a variable as a format string. Also we usually don't
expect non-ascii data in C string literals.
-rw-r--r-- | spec/ruby/optional/capi/ext/encoding_spec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/ruby/optional/capi/ext/encoding_spec.c b/spec/ruby/optional/capi/ext/encoding_spec.c index 0ebbc9d75a..3343848b54 100644 --- a/spec/ruby/optional/capi/ext/encoding_spec.c +++ b/spec/ruby/optional/capi/ext/encoding_spec.c @@ -275,7 +275,7 @@ static VALUE encoding_spec_rb_enc_raise(VALUE self, VALUE encoding, VALUE except rb_encoding *e = rb_to_encoding(encoding); const char *f = RSTRING_PTR(format); - rb_enc_raise(e, exception_class, f); + rb_enc_raise(e, exception_class, "%s", f); } static VALUE encoding_spec_rb_uv_to_utf8(VALUE self, VALUE buf, VALUE num) { |