summaryrefslogtreecommitdiffstats
path: root/src/fidentify.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-04-11 14:23:16 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-04-11 14:23:16 +0200
commit67054372873f2ed5414da7fff1cb5744148289d6 (patch)
treea8cd9501bcfc1e1efec8ca6603e7f11b0ad2ec0c /src/fidentify.c
parentefc94ee87ac3b4e3ecf4fb3ab4adac2ef0a6278f (diff)
add gcc_struct attribute to all __packed__ structure
do not use fseeko() with mingw32 gcc compiler
Diffstat (limited to 'src/fidentify.c')
-rw-r--r--src/fidentify.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/fidentify.c b/src/fidentify.c
index 6d0949d..824924e 100644
--- a/src/fidentify.c
+++ b/src/fidentify.c
@@ -56,6 +56,11 @@ extern file_enable_t list_file_enable[];
extern file_check_list_t file_check_list;
#define READ_SIZE 1024*512
+#if defined(HAVE_FSEEKO) && !defined(__MINGW32__)
+#define my_fseek fseeko
+#else
+#define my_fseek fseek
+#endif
static int file_identify(const char *filename, const unsigned int check)
{
@@ -115,11 +120,7 @@ static int file_identify(const char *filename, const unsigned int check)
if(check > 0 && file_recovery_new.file_check!=NULL)
{
file_recovery_new.handle=file;
-#ifdef HAVE_FSEEKO
- fseeko(file_recovery_new.handle, 0, SEEK_END);
-#else
- fseek(file_recovery_new.handle, 0, SEEK_END);
-#endif
+ my_fseek(file_recovery_new.handle, 0, SEEK_END);
#ifdef HAVE_FTELLO
file_recovery_new.file_size=ftello(file_recovery_new.handle);
#else