diff options
author | Bryce Harrington <b.harrington@samsung.com> | 2014-01-29 10:01:50 -0800 |
---|---|---|
committer | Bryce Harrington <b.harrington@samsung.com> | 2014-01-31 11:25:43 -0800 |
commit | 0723290a6f7261be51312d0c53a7d4188a31bb1c (patch) | |
tree | 766307cf3b7d137216543196d8c46e67ba0b3516 | |
parent | 1b522f81e22fd320e6962ffb54121c10ece39275 (diff) |
test: Handle error in fgets call in ps-eps test
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 <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | test/ps-eps.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); |