ext/console/console.c in console-0.4 vs ext/console/console.c in console-0.5

- old
+ new

@@ -29,14 +29,17 @@ else if(*num_bytes == (size_t)-1) { rb_raise(rb_eArgError, "malformed string: invalid multibyte character at position %ld", byte_offset); return -1; } else if(*num_bytes == 0) { - rb_raise(rb_eArgError, "malformed string: NULL byte at position %ld", byte_offset); - return -1; + //rb_raise(rb_eArgError, "malformed string: NULL byte at position %ld", byte_offset); + // it's fine to have a NULL byte. forge ahead! + *num_bytes = 1; + *num_cols = 0; } - - *num_cols = wcwidth(wc); + else { + *num_cols = wcwidth(wc); + } return 0; } /*