From 7993b88eeec79cce14b04c37f91b0adc3ee1e14f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 17 Jul 2024 12:03:21 -0400 Subject: [PATCH] [PRISM] Use StringValuePtr for fgets for Prism stream parsing --- prism_compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prism_compile.c b/prism_compile.c index acdb57661a..c68d552eca 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -10501,8 +10501,8 @@ pm_parse_stdin_fgets(char *string, int size, void *stream) return NULL; } - const char *cstr = StringValueCStr(line); - size_t length = strlen(cstr); + const char *cstr = StringValuePtr(line); + long length = rb_str_strlen(line); memcpy(string, cstr, length); string[length] = '\0';