fix warning: 'r' may be used uninitialized in this function

This commit is contained in:
Thomas Bernard 2019-07-24 03:20:12 +02:00
parent eb0b9eae62
commit e56d193354
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -4078,7 +4078,7 @@ void Load_GPX(T_IO_Context * context)
{ {
byte * gpx = NULL; byte * gpx = NULL;
unsigned long gpx_size = 0; unsigned long gpx_size = 0;
int r; int r = Z_MEM_ERROR;
do do
{ {
@ -4086,9 +4086,7 @@ void Load_GPX(T_IO_Context * context)
gpx_size += 65536; gpx_size += 65536;
gpx = GFX2_malloc(gpx_size); gpx = GFX2_malloc(gpx_size);
if (gpx == NULL) if (gpx == NULL)
{
break; break;
}
r = uncompress(gpx, &gpx_size, buffer, file_size); r = uncompress(gpx, &gpx_size, buffer, file_size);
if (r != Z_BUF_ERROR && r != Z_OK) if (r != Z_BUF_ERROR && r != Z_OK)
GFX2_Log(GFX2_ERROR, "uncompress() failed with error %d: %s\n", r, zError(r)); GFX2_Log(GFX2_ERROR, "uncompress() failed with error %d: %s\n", r, zError(r));