diff options
Diffstat (limited to 'marshal.c')
-rw-r--r-- | marshal.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -468,7 +468,7 @@ w_object(obj, arg, limit) return; } - if (ivtbl = rb_generic_ivar_table(obj)) { + if ((ivtbl = rb_generic_ivar_table(obj)) != 0) { w_byte(TYPE_IVAR, arg); } if (obj == Qnil) { @@ -873,7 +873,7 @@ r_bytes0(len, arg) if (len == 0) return rb_str_new(0, 0); if (TYPE(arg->src) == T_STRING) { - if (RSTRING(arg->src)->len > arg->offset) { + if (RSTRING(arg->src)->len - arg->offset >= len) { str = rb_str_new(RSTRING(arg->src)->ptr+arg->offset, len); arg->offset += len; } |