io.c: wrote is allowed to be a null pointer