Add printf-style format attribute to oniguruma functions

Also make the format string compatible with literal strings which
are const arrays of "plain" chars.
This commit is contained in:
Nobuyoshi Nakada 2021-09-27 19:02:45 +09:00 committed by GitHub
parent f8000e2931
commit efa0c31ce5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2021-09-27 19:03:06 +09:00
Merged: https://github.com/ruby/ruby/pull/4899

Merged-By: nobu <nobu@ruby-lang.org>
3 changed files with 13 additions and 5 deletions

View file

@ -312,7 +312,7 @@ onig_error_code_to_str(UChar* s, OnigPosition code, ...)
void
onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
UChar* pat, UChar* pat_end, const UChar *fmt, va_list args)
UChar* pat, UChar* pat_end, const char *fmt, va_list args)
{
size_t need;
int n, len;
@ -376,7 +376,7 @@ onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
#if 0 /* unused */
void
onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
UChar* pat, UChar* pat_end, const UChar *fmt, ...)
UChar* pat, UChar* pat_end, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);