summaryrefslogtreecommitdiffstats
path: root/src/file_ace.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_ace.c
parent4c5fcd4164b7fd06eafa54fa44ecfb9fb2d02d00 (diff)
Use fseeko() instead of fseek().
Fix 2GB per file limit on Windows for some file types.
Diffstat (limited to 'src/file_ace.c')
-rw-r--r--src/file_ace.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/file_ace.c b/src/file_ace.c
index 7cfa8fa..656860f 100644
--- a/src/file_ace.c
+++ b/src/file_ace.c
@@ -65,7 +65,11 @@ static void file_check_ace(file_recovery_t *file_recovery)
file_recovery->offset_error = 0;
file_recovery->offset_ok = 0;
file_recovery->file_size = 0;
+#ifdef HAVE_FSEEKO
+ if(fseeko(file_recovery->handle, 0, SEEK_SET)<0)
+#else
if(fseek(file_recovery->handle, 0, SEEK_SET)<0)
+#endif
return ;
#ifdef DEBUG_ACE
log_trace("file_check_ace\n");
@@ -84,7 +88,11 @@ static void file_check_ace(file_recovery_t *file_recovery)
file_recovery->file_size=0;
return ;
}
+#ifdef HAVE_FSEEKO
+ if(fseeko(file_recovery->handle, -sizeof(h)+4, SEEK_CUR)<0)
+#else
if(fseek(file_recovery->handle, -sizeof(h)+4, SEEK_CUR)<0)
+#endif
{
file_recovery->offset_error=file_recovery->file_size;
file_recovery->file_size=0;
@@ -163,7 +171,11 @@ static void file_check_ace(file_recovery_t *file_recovery)
if (le16(h.flags)&1)
{
file_recovery->file_size += le32(h.addsize);
+#ifdef HAVE_FSEEKO
+ if(fseeko(file_recovery->handle, file_recovery->file_size, SEEK_SET)<0)
+#else
if(fseek(file_recovery->handle, file_recovery->file_size, SEEK_SET)<0)
+#endif
{
file_recovery->offset_error=file_recovery->file_size;
file_recovery->file_size=0;