check Ruby strings for embedded null bytes
The RGSS doesn't do it. But doing it shouldn't be a problem, as it's the correct way. If a game is broken by this commit (unlikely), then the game needs to be fixed as silent truncation is highly unlikely to be wanted.
This commit is contained in:
parent
a365a7a754
commit
29dfda0011
2 changed files with 2 additions and 2 deletions
|
@ -32,7 +32,7 @@ DEF_TYPE(Bitmap);
|
|||
static const char *objAsStringPtr(VALUE obj)
|
||||
{
|
||||
VALUE str = rb_obj_as_string(obj);
|
||||
return RSTRING_PTR(str);
|
||||
return StringValueCStr(str);
|
||||
}
|
||||
|
||||
void bitmapInitProps(Bitmap *b, VALUE self)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue