fix strip-semicolon using original file handle size

This commit is contained in:
skytrias
2021-10-23 00:12:32 +02:00
parent 7218a68e89
commit 6399f2b014
2 changed files with 8 additions and 4 deletions
+4 -1
View File
@@ -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);