ext/fiddle/pointer.c in fiddle-1.1.5 vs ext/fiddle/pointer.c in fiddle-1.1.6
- old
+ new
@@ -825,10 +825,11 @@
* Write bytes in +str+ to the location pointed to by +address+.
*/
static VALUE
rb_fiddle_ptr_write_mem(VALUE klass, VALUE addr, VALUE str)
{
- memcpy(NUM2PTR(addr), StringValuePtr(str), RSTRING_LEN(str));
+ const char *ptr = StringValuePtr(str);
+ memcpy(NUM2PTR(addr), ptr, RSTRING_LEN(str));
return str;
}
void
Init_fiddle_pointer(void)