summaryrefslogtreecommitdiffstats
path: root/src/file_mlv.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-10-04 18:09:48 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-10-04 18:09:48 +0200
commitc28950032981dafb83ec5c568a16e030c4467226 (patch)
tree05156e7f64df839808af64cd455c8b864a1eda18 /src/file_mlv.c
parent4c5fcd4164b7fd06eafa54fa44ecfb9fb2d02d00 (diff)
Use fseeko() instead of fseek().
Fix 2GB per file limit on Windows for some file types.
Diffstat (limited to 'src/file_mlv.c')
-rw-r--r--src/file_mlv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/file_mlv.c b/src/file_mlv.c
index e3bff65..add3fed 100644
--- a/src/file_mlv.c
+++ b/src/file_mlv.c
@@ -98,7 +98,12 @@ static void file_check_mlv(file_recovery_t *file_recovery)
uint64_t fs=0;
do
{
- if( fseek(file_recovery->handle, fs, SEEK_SET)<0 ||
+ if(
+#ifdef HAVE_FSEEKO
+ fseeko(file_recovery->handle, fs, SEEK_SET)<0 ||
+#else
+ fseek(file_recovery->handle, fs, SEEK_SET)<0 ||
+#endif
fread(&hdr, sizeof(hdr), 1, file_recovery->handle)!=1 ||
le32(hdr.blockSize)<0x10 ||
!is_valid_type(&hdr) ||
@@ -110,7 +115,6 @@ static void file_check_mlv(file_recovery_t *file_recovery)
fs+=le32(hdr.blockSize);
} while(1);
}
-
static int header_check_mlv(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)
{
const mlv_file_hdr_t *hdr=(const mlv_file_hdr_t *)buffer;