mruby-io/io.c: small format updates
MODIFY
mrbgems/mruby-io/src/io.c
mrbgems/mruby-io/src/io.c
@@ -999,19 +999,21 @@ mrb_io_syswrite_common(mrb_state *mrb,
mrb_value io, mrb_value buf, off_t offset)
{
struct mrb_io *fptr;
- int fd, length;
+ int fd;
+ fsize_t length;
+ mrb_io_read_write_size n;
fptr = io_get_write_fptr(mrb, io);
if (fptr->fd2 == -1) {
fd = fptr->fd;
- } else {
+ }
+ else {
fd = fptr->fd2;
}
length = writefunc(fd, RSTRING_PTR(buf), (fsize_t)RSTRING_LEN(buf), offset);
if (length == -1) {
- mrb_sys_fail(mrb, 0);
+ mrb_sys_fail(mrb, "syswrite");
}
-
return mrb_int_value(mrb, (mrb_int)length);
}

mruby-io/io.c: small format updates