summaryrefslogtreecommitdiffstats
path: root/src/photorec.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/photorec.c
parent4c5fcd4164b7fd06eafa54fa44ecfb9fb2d02d00 (diff)
Use fseeko() instead of fseek().
Fix 2GB per file limit on Windows for some file types.
Diffstat (limited to 'src/photorec.c')
-rw-r--r--src/photorec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/photorec.c b/src/photorec.c
index 9d9c2e4..170fe59 100644
--- a/src/photorec.c
+++ b/src/photorec.c
@@ -1122,7 +1122,11 @@ void file_block_truncate_and_move(file_recovery_t *file_recovery, alloc_data_t *
uint64_t i;
unsigned char *block_buffer;
block_buffer=&buffer[blocksize];
+#ifdef HAVE_FSEEKO
+ if(fseeko(file_recovery->handle, 0, SEEK_SET) < 0)
+#else
if(fseek(file_recovery->handle, 0, SEEK_SET) < 0)
+#endif
return ;
for(i=0; i< file_recovery->file_size; i+= blocksize)
{
@@ -1133,5 +1137,11 @@ void file_block_truncate_and_move(file_recovery_t *file_recovery, alloc_data_t *
}
}
else
+ {
+#ifdef HAVE_FSEEKO
+ fseeko(file_recovery->handle, file_recovery->file_size, SEEK_SET);
+#else
fseek(file_recovery->handle, file_recovery->file_size, SEEK_SET);
+#endif
+ }
}