1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
From: Ilya Barygin <barygin@gmail.com>
Date: Sat, 22 Mar 2014 22:16:49 +0100
Subject: FTBFS with fread
Fix FTBFS due to unused return value of fread in anim.c. Check that fread
actually returns a value under all circumstances.
Bug: https://bugs.debian.org/552022
Forwarded: no
---
utils/anim.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/utils/anim.c b/utils/anim.c
index 8a2871f..ca631a5 100644
--- a/utils/anim.c
+++ b/utils/anim.c
@@ -32,7 +32,8 @@ void write_file(FILE * out, char *filename)
data = (Uint8 *) malloc(theStat.st_size);
size = theStat.st_size;
fwrite(&size, sizeof(Uint32), 1, out);
- fread(data, theStat.st_size, 1, in);
+ if (fread(data, theStat.st_size, 1, in) != 1)
+ errorcc("Error reading from file, ", filename);
fwrite(data, theStat.st_size, 1, out);
free(data);
fclose(in);
|