mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-01 04:10:07 +00:00
fix strip-semicolon using original file handle size
This commit is contained in:
+4
-1
@@ -6030,8 +6030,11 @@ gb_inline b32 gb_file_copy(char const *existing_filename, char const *new_filena
|
||||
|
||||
struct stat stat_existing;
|
||||
fstat(existing_fd, &stat_existing);
|
||||
|
||||
size = sendfile(new_fd, existing_fd, 0, stat_existing.st_size);
|
||||
|
||||
// set new handle to wanted size for safety
|
||||
int i = ftruncate(new_fd, size);
|
||||
GB_ASSERT(i == 0);
|
||||
|
||||
close(new_fd);
|
||||
close(existing_fd);
|
||||
|
||||
Reference in New Issue
Block a user