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>
This commit is contained in:
Bryce Harrington 2014-01-29 10:01:50 -08:00
parent 1b522f81e2
commit 0723290a6f

View file

@ -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);