Writing issue solved

Because fwrite() can not write more of 4096B at once