summaryrefslogtreecommitdiffstats
path: root/src/file_tib.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_tib.c
parent4c5fcd4164b7fd06eafa54fa44ecfb9fb2d02d00 (diff)
Use fseeko() instead of fseek().
Fix 2GB per file limit on Windows for some file types.
Diffstat (limited to 'src/file_tib.c')
-rw-r--r--src/file_tib.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/file_tib.c b/src/file_tib.c
index a21f4ac..2fb9c30 100644
--- a/src/file_tib.c
+++ b/src/file_tib.c
@@ -67,7 +67,12 @@ static void file_check_tib2(file_recovery_t *file_recovery)
unsigned char*buffer=(unsigned char*)MALLOC(512);
int64_t file_size=file_recovery->calculated_file_size-512;
file_recovery->file_size = file_recovery->calculated_file_size;
- if(fseek(file_recovery->handle, file_size, SEEK_SET) < 0 ||
+ if(
+#ifdef HAVE_FSEEKO
+ fseeko(file_recovery->handle, file_size, SEEK_SET) < 0 ||
+#else
+ fseek(file_recovery->handle, file_size, SEEK_SET) < 0 ||
+#endif
fread(buffer, 1, 512, file_recovery->handle) != 512)
{
free(buffer);
@@ -83,7 +88,12 @@ static void file_check_tib2(file_recovery_t *file_recovery)
for(; file_size>0; file_size-=512)
{
unsigned int i;
- if(fseek(file_recovery->handle, file_size, SEEK_SET) < 0 ||
+ if(
+#ifdef HAVE_FSEEKO
+ fseeko(file_recovery->handle, file_size, SEEK_SET) < 0 ||
+#else
+ fseek(file_recovery->handle, file_size, SEEK_SET) < 0 ||
+#endif
fread(buffer, 1, 512, file_recovery->handle) != 512)
{
free(buffer);