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.
This commit is contained in:
Nobuyoshi Nakada 2023-10-31 00:56:42 +09:00
parent 7bf3d9343f
commit 2ab247d217
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -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) {