projects
/
onyx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74f9749
)
fixed issue when writing to a file more than once
author
Brendan Hansen
<brendan.f.hansen@gmail.com>
Mon, 19 Apr 2021 20:02:20 +0000
(15:02 -0500)
committer
Brendan Hansen
<brendan.f.hansen@gmail.com>
Mon, 19 Apr 2021 20:02:20 +0000
(15:02 -0500)
include/bh.h
patch
|
blob
|
history
diff --git
a/include/bh.h
b/include/bh.h
index 69b2becfccf1b47becd2a22d77fecf47d2921348..4b3586da28c51ed619aba14e13c76e2f5c340c01 100644
(file)
--- a/
include/bh.h
+++ b/
include/bh.h
@@
-1412,9
+1412,9
@@
b32 bh_file_read_at(bh_file* file, i64 offset, void* buffer, isize buff_size, is
b32 bh_file_write_at(bh_file* file, i64 offset, void const* buffer, isize buff_size, isize* bytes_wrote) {
isize res;
i64 current_offset = 0;
+ bh__file_seek_wrapper(file->fd, 0, BH_FILE_WHENCE_CURRENT, ¤t_offset);
#if defined(_BH_WINDOWS)
- bh__file_seek_wrapper(file->fd, 0, BH_FILE_WHENCE_CURRENT, ¤t_offset);
res = (isize) WriteFile(file->fd, buffer, buff_size, (i32 *) bytes_wrote, NULL);
return res;