`IO#syswrite`: Always check if there is a buffer before getting it's length - Fixes #778
--- MacRuby/trunk/io.c 2010-07-08 23:45:37 UTC (rev 4335)
+++ MacRuby/trunk/io.c 2010-07-08 23:55:33 UTC (rev 4336)
@@ -400,7 +400,7 @@
data = rb_str_bstr(rb_obj_as_string(data));
- if (CFDataGetLength(io_struct->buf) > 0) {
+ if (io_struct->buf && CFDataGetLength(io_struct->buf) > 0) {
rb_warn("Calling #syswrite on buffered I/O may lead to unexpected results");
}