diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-11-26 10:31:09 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-11-26 10:33:33 +0000 |
commit | 039437c9cfaeed7a2cc1977623ab8bda9854b58a (patch) | |
tree | ac26a41f4bfda97a7de10732f41d646c154861b2 /src/cairo-png.c | |
parent | 8fa3cd95641e9138406d651b0734ee84f1da60d2 (diff) | |
download | cairo-039437c9cfaeed7a2cc1977623ab8bda9854b58a.tar.gz |
[png] Use FILE* instead of void*.
Adrian Johnson reported that cygwin complained about the use of the void *
within feof() as it was using a macro and attempted a to deference the
void*...
Diffstat (limited to 'src/cairo-png.c')
-rw-r--r-- | src/cairo-png.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cairo-png.c b/src/cairo-png.c index e8f61b5da..5bb658cbe 100644 --- a/src/cairo-png.c +++ b/src/cairo-png.c @@ -462,14 +462,16 @@ convert_bytes_to_data (png_structp png, png_row_infop row_info, png_bytep data) static cairo_status_t stdio_read_func (void *closure, unsigned char *data, unsigned int size) { + FILE *file = closure; + while (size) { size_t ret; - ret = fread (data, 1, size, closure); + ret = fread (data, 1, size, file); size -= ret; data += ret; - if (size && (feof (closure) || ferror (closure))) + if (size && (feof (file) || ferror (file))) return _cairo_error (CAIRO_STATUS_READ_ERROR); } |