diff options
author | Quentin Glidic <sardemff7+git@sardemff7.net> | 2016-07-10 11:00:51 +0200 |
---|---|---|
committer | Quentin Glidic <sardemff7+git@sardemff7.net> | 2016-08-15 16:31:00 +0200 |
commit | 9ba15461728488f0eccf665de2e3bd884d5de201 (patch) | |
tree | 3e61d92a4c38d462db2a97398182288a998b1eba /shared | |
parent | d84af7ccc56c3339a5d485594cb2ec80277d8b53 (diff) |
shared/image: Silence maybe-uninitialized warning
shared/image-loader.c: In function 'load_image':
shared/image-loader.c:434:12: warning: 'image' may be used uninitialized
in this function [-Wmaybe-uninitialized]
} else if (!image) {
^
Warning produced by GCC 5.3 and 6.1, with -Og.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Diffstat (limited to 'shared')
-rw-r--r-- | shared/image-loader.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/shared/image-loader.c b/shared/image-loader.c index 30b57cd4..14096816 100644 --- a/shared/image-loader.c +++ b/shared/image-loader.c @@ -396,7 +396,7 @@ static const struct image_loader loaders[] = { pixman_image_t * load_image(const char *filename) { - pixman_image_t *image; + pixman_image_t *image = NULL; unsigned char header[4]; FILE *fp; unsigned int i; @@ -431,7 +431,6 @@ load_image(const char *filename) fprintf(stderr, "%s: unrecognized file header " "0x%02x 0x%02x 0x%02x 0x%02x\n", filename, header[0], header[1], header[2], header[3]); - image = NULL; } else if (!image) { /* load probably printed something, but just in case */ fprintf(stderr, "%s: error reading image\n", filename); |