From e56d193354614278bc9eadfd04895ca45a666106 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Wed, 24 Jul 2019 03:20:12 +0200 Subject: [PATCH] fix warning: 'r' may be used uninitialized in this function --- src/miscfileformats.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/miscfileformats.c b/src/miscfileformats.c index 3364d261..63d37935 100644 --- a/src/miscfileformats.c +++ b/src/miscfileformats.c @@ -4078,7 +4078,7 @@ void Load_GPX(T_IO_Context * context) { byte * gpx = NULL; unsigned long gpx_size = 0; - int r; + int r = Z_MEM_ERROR; do { @@ -4086,9 +4086,7 @@ void Load_GPX(T_IO_Context * context) gpx_size += 65536; gpx = GFX2_malloc(gpx_size); if (gpx == NULL) - { break; - } r = uncompress(gpx, &gpx_size, buffer, file_size); if (r != Z_BUF_ERROR && r != Z_OK) GFX2_Log(GFX2_ERROR, "uncompress() failed with error %d: %s\n", r, zError(r));