mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
[PRISM] Use StringValuePtr for fgets for Prism stream parsing
This commit is contained in:
parent
99825a539f
commit
7993b88eee
Notes:
git
2024-07-17 17:59:15 +00:00
1 changed files with 2 additions and 2 deletions
|
@ -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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue