Skip to content

Commit 36d02dc

Browse files
committed
Fix format modifier for size_t
Also fix the message, just `RB_GC_MAX_NAME_LEN` chars long is OK.
1 parent c129e01 commit 36d02dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

gc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,9 +2780,10 @@ const char *
27802780
rb_gc_active_gc_name(void)
27812781
{
27822782
const char *gc_name = rb_gc_impl_active_gc_name();
2783-
if (strlen(gc_name) > RB_GC_MAX_NAME_LEN) {
2784-
rb_bug("GC should have a name shorter than %d chars. Currently: %lu (%s)",
2785-
RB_GC_MAX_NAME_LEN, strlen(gc_name), gc_name);
2783+
const size_t len = strlen(gc_name);
2784+
if (len > RB_GC_MAX_NAME_LEN) {
2785+
rb_bug("GC should have a name no more than %d chars long. Currently: %zu (%s)",
2786+
RB_GC_MAX_NAME_LEN, len, gc_name);
27862787
}
27872788
return gc_name;
27882789

0 commit comments

Comments
 (0)