31 lines
1.0 KiB
Diff
31 lines
1.0 KiB
Diff
--- a/src/parsley.cpp
|
|
+++ b/src/parsley.cpp
|
|
@@ -4585,10 +4585,11 @@
|
|
#if defined(_MSC_VER)
|
|
fpos_t file_offset = dest_position + file_pos;
|
|
#elif defined(__GLIBC__)
|
|
- fpos_t file_offset = {0};
|
|
+ fpos_t file_offset = {0};
|
|
file_offset.__pos = dest_position + file_pos;
|
|
#else
|
|
- off_t file_offset = dest_position + file_pos;
|
|
+ fpos_t file_offset = {0};
|
|
+ *(uint64_t*) &file_offset = dest_position + file_pos;
|
|
#endif
|
|
fsetpos(dest_file, &file_offset);
|
|
fwrite(buffer, (size_t)max_buffer, 1, dest_file);
|
|
@@ -4601,10 +4601,11 @@
|
|
#if defined(_MSC_VER)
|
|
fpos_t file_offset = dest_position + file_pos;
|
|
#elif defined(__GLIBC__)
|
|
- fpos_t file_offset = {0};
|
|
+ fpos_t file_offset = {0};
|
|
file_offset.__pos = dest_position + file_pos;
|
|
#else
|
|
- off_t file_offset = dest_position + file_pos;
|
|
+ fpos_t file_offset = {0};
|
|
+ *(uint64_t*) &file_offset = dest_position + file_pos;
|
|
#endif
|
|
fsetpos(dest_file, &file_offset );
|
|
fwrite(buffer, (size_t)(src_file_size - file_pos), 1, dest_file);
|