Skip to content

Commit 13c6202

Browse files
authored
Merge pull request #536 from RJPercival/format-security-error
Fixes format-security error when compiling ruby_193_compatible.h
2 parents 0d044be + b3fa771 commit 13c6202

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/concurrent/ruby_193_compatible.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#define UNLIMITED_ARGUMENTS (-1)
77

8-
static inline void rb_error_arity(int argc, int min, int max)
8+
static inline VALUE rb_error_arity(int argc, int min, int max)
99
{
1010
VALUE err_mess = 0;
1111
if (min == max) {
@@ -17,12 +17,12 @@ static inline void rb_error_arity(int argc, int min, int max)
1717
else {
1818
err_mess = rb_sprintf("wrong number of arguments (%d for %d..%d)", argc, min, max);
1919
}
20-
rb_raise(rb_eTypeError, err_mess);
20+
return rb_exc_new3(rb_eTypeError, err_mess);
2121
}
2222

2323
#define rb_check_arity(argc, min, max) do { \
2424
if (((argc) < (min)) || ((argc) > (max) && (max) != UNLIMITED_ARGUMENTS)) \
25-
rb_error_arity(argc, min, max); \
25+
rb_exc_raise(rb_error_arity(argc, min, max)); \
2626
} while(0)
2727

2828
#endif

0 commit comments

Comments
 (0)