add an assert
This commit is contained in:
@@ -265,6 +265,7 @@ fn Resulti64 osFileClose(Resulti64 handle) {
|
|||||||
|
|
||||||
fn bool osFileWriteOpenFile(Resulti64 handle, String data) {
|
fn bool osFileWriteOpenFile(Resulti64 handle, String data) {
|
||||||
assert(handle.success == true);
|
assert(handle.success == true);
|
||||||
|
assert(data.length <= data.capacity);
|
||||||
i32 wrote_this_round = 0;
|
i32 wrote_this_round = 0;
|
||||||
for (u32 bytes_written = 0; bytes_written < data.length; bytes_written += wrote_this_round) {
|
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);
|
wrote_this_round = write((size_t)handle.value, data.bytes + bytes_written, data.length - bytes_written);
|
||||||
|
|||||||
Reference in New Issue
Block a user