summaryrefslogtreecommitdiffstats
path: root/src/file_mid.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_mid.c
parent4c5fcd4164b7fd06eafa54fa44ecfb9fb2d02d00 (diff)
Use fseeko() instead of fseek().
Fix 2GB per file limit on Windows for some file types.
Diffstat (limited to 'src/file_mid.c')
-rw-r--r--src/file_mid.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/file_mid.c b/src/file_mid.c
index 464f4b3..2c45861 100644
--- a/src/file_mid.c
+++ b/src/file_mid.c
@@ -62,7 +62,12 @@ static void file_check_midi(file_recovery_t *file_recovery)
unsigned int i;
uint64_t fs=4+4+6;
file_recovery->file_size=0;
- if(fseek(file_recovery->handle, 0, SEEK_SET) < 0 ||
+ if(
+#ifdef HAVE_FSEEKO
+ fseeko(file_recovery->handle, 0, SEEK_SET) < 0 ||
+#else
+ fseek(file_recovery->handle, 0, SEEK_SET) < 0 ||
+#endif
fread(&hdr, sizeof(hdr), 1, file_recovery->handle) != 1)
return ;
for(i=0; i<be16(hdr.tracks); i++)
@@ -71,7 +76,11 @@ static void file_check_midi(file_recovery_t *file_recovery)
#ifdef DEBUG_MIDI
log_info("file_check_midi 0x%08llx\n", (unsigned long long)fs);
#endif
+#ifdef HAVE_FSEEKO
+ if(fseeko(file_recovery->handle, fs, SEEK_SET) < 0 ||
+#else
if(fseek(file_recovery->handle, fs, SEEK_SET) < 0 ||
+#endif
fread(&track, 8, 1, file_recovery->handle) != 1 ||
memcmp(&track.magic[0], "MTrk", 4)!=0)
return ;