[opentyrian] 06/06: patch a call to fread
Etienne Millon
emillon-guest at moszumanska.debian.org
Mon Jan 5 15:09:04 UTC 2015
This is an automated email from the git hooks/post-receive script.
emillon-guest pushed a commit to branch master
in repository opentyrian.
commit 65d5719754e77950028790cb1acebae4fe1e20f3
Author: Etienne Millon <me at emillon.org>
Date: Mon Jan 5 15:52:09 2015 +0100
patch a call to fread
---
debian/patches/check-return-values.patch | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/debian/patches/check-return-values.patch b/debian/patches/check-return-values.patch
index 6941c69..fac3c5a 100644
--- a/debian/patches/check-return-values.patch
+++ b/debian/patches/check-return-values.patch
@@ -1,8 +1,10 @@
Author: Etienne Millon <me at emillon.org>
Subject: Check return values
-Make efread/efwrite check their return values.
-This can be done with an assert() since the actual return value is not used.
+ - Make efread/efwrite check their return values.
+ This can be done with an assert() since the actual return value is not used.
+
+ - Patch a call to fread.
--- a/src/file.c
+++ b/src/file.c
@@ -87,3 +89,15 @@ This can be done with an assert() since the actual return value is not used.
#endif // FILE_H
+--- a/src/config.c
++++ b/src/config.c
+@@ -223,7 +223,8 @@
+ size_t buffer_len = ftell_eof(f);
+ char *buffer = malloc(buffer_len + 1);
+
+- fread(buffer, 1, buffer_len, f);
++ size_t res = fread(buffer, 1, buffer_len, f);
++ assert(res == buffer_len);
+ buffer[buffer_len] = '\0';
+
+ fclose(f);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/opentyrian.git
More information about the Pkg-games-commits
mailing list