[PATCH 2/6] test: Handle error in fgets call in ps-eps test

"Bryce W. Harrington" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Most likely this is just a theoretical problem since we just checked
feof, but this quells the following warning:

ps-eps.c:216:8: warning: ignoring return value of ‘fgets’, declared with
attribute warn_unused_result [-Wunused-result]

Signed-off-by: Bryce Harrington <[email protected]>
---
 test/ps-eps.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/ps-eps.c b/test/ps-eps.c
index 66224e2..de1248d 100644
--- a/test/ps-eps.c
+++ b/test/ps-eps.c
@@ -213,7 +213,11 @@ check_bbox (cairo_test_context_t *ctx,
     bbox_pass = FALSE;
     page_bbox_pass = FALSE;
     while (!feof(f)) {
-	fgets (buf, sizeof(buf), f);
+	if (fgets (buf, sizeof(buf), f) == (char *)EOF) {
+	    cairo_test_log (ctx, "Error: Unexpected EOF in %s\n",
+			    filename);
+	    break;
+	}
 
 	if (strncmp (buf, DOCUMENT_BBOX, strlen (DOCUMENT_BBOX)) == 0) {
 	    ret = sscanf (buf+strlen (DOCUMENT_BBOX), "%d %d %d %d", &llx, &lly, &urx, &ury);
-- 
1.7.9.5
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.