summaryrefslogtreecommitdiffstats
path: root/src/file_gpg.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_gpg.c
parent4c5fcd4164b7fd06eafa54fa44ecfb9fb2d02d00 (diff)
Use fseeko() instead of fseek().
Fix 2GB per file limit on Windows for some file types.
Diffstat (limited to 'src/file_gpg.c')
-rw-r--r--src/file_gpg.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/file_gpg.c b/src/file_gpg.c
index ba92268..732efbc 100644
--- a/src/file_gpg.c
+++ b/src/file_gpg.c
@@ -252,7 +252,12 @@ static void file_check_gpg(file_recovery_t *file_recovery)
unsigned int length_type=0;
unsigned int length;
const int old_partial_body_length=partial_body_length;
- if(fseek(file_recovery->handle, offset, SEEK_SET) < 0 ||
+ if(
+#ifdef HAVE_FSEEKO
+ fseeko(file_recovery->handle, offset, SEEK_SET) < 0 ||
+#else
+ fseek(file_recovery->handle, offset, SEEK_SET) < 0 ||
+#endif
fread(&buffer, sizeof(buffer), 1, file_recovery->handle) != 1)
return;
@@ -313,7 +318,12 @@ static void file_check_gpg(file_recovery_t *file_recovery)
{
int len2;
unsigned char tmp[2];
- if(fseek(file_recovery->handle, offset+1+8+1+2+len, SEEK_SET) < 0 ||
+ if(
+#ifdef HAVE_FSEEKO
+ fseeko(file_recovery->handle, offset+1+8+1+2+len, SEEK_SET) < 0 ||
+#else
+ fseek(file_recovery->handle, offset+1+8+1+2+len, SEEK_SET) < 0 ||
+#endif
fread(&tmp, sizeof(tmp), 1, file_recovery->handle) != 1)
return;
mpi=(const uint16_t *)&tmp[0];