Skip to content

Commit bd5d38e

Browse files
handle null write
1 parent 5e3b500 commit bd5d38e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/linker/lnk_io.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ lnk_write_data_list_to_file_path(String8 path, String8List data)
173173
if (lnk_open_file_write((char*)path.str, path.size, &handle, sizeof(handle))) {
174174
U64 offset = 0;
175175
for (String8Node *data_n = data.first; data_n != 0; data_n = data_n->next) {
176-
if (!lnk_write_file(&handle, offset, data_n->string.str, data_n->string.size)) {
176+
U64 write_size = lnk_write_file(&handle, offset, data_n->string.str, data_n->string.size);
177+
if (write_size != data_n->string.size) {
177178
break;
178179
}
179180
offset += data_n->string.size;

0 commit comments

Comments
 (0)