summaryrefslogtreecommitdiffstats
path: root/src/file_tib.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-11-01 12:18:57 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-11-01 12:18:57 +0100
commit78ab592e113e29cec48a45913a43e22aefd9f94a (patch)
tree55f7f0ad97fedce2a26028c0e9e74ecfde581584 /src/file_tib.c
parent2237a01ed0065e6e9f4fa70d59a76a8acc8f42aa (diff)
src/file_tib.c: stricter check for fread error
Diffstat (limited to 'src/file_tib.c')
-rw-r--r--src/file_tib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file_tib.c b/src/file_tib.c
index cc29b67..0c359b3 100644
--- a/src/file_tib.c
+++ b/src/file_tib.c
@@ -76,7 +76,7 @@ static void file_check_tib(file_recovery_t *file_recovery)
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 ||
- fread(buffer, 1, 512, file_recovery->handle) <= 0)
+ fread(buffer, 1, 512, file_recovery->handle) != 512)
{
free(buffer);
file_recovery->file_size=0;
@@ -92,7 +92,7 @@ static void file_check_tib(file_recovery_t *file_recovery)
{
unsigned int i;
if(fseek(file_recovery->handle, file_size, SEEK_SET) < 0 ||
- fread(buffer, 1, 512, file_recovery->handle) <= 0)
+ fread(buffer, 1, 512, file_recovery->handle) != 512)
{
free(buffer);
file_recovery->file_size=0;