diff --git a/unix_os.c b/unix_os.c index 766a005..aafdf5d 100644 --- a/unix_os.c +++ b/unix_os.c @@ -265,6 +265,7 @@ fn Resulti64 osFileClose(Resulti64 handle) { fn bool osFileWriteOpenFile(Resulti64 handle, String data) { assert(handle.success == true); + assert(data.length <= data.capacity); i32 wrote_this_round = 0; for (u32 bytes_written = 0; bytes_written < data.length; bytes_written += wrote_this_round) { wrote_this_round = write((size_t)handle.value, data.bytes + bytes_written, data.length - bytes_written);