fixed compiler warning
authorHolger Schemel <info@artsoft.org>
Sun, 17 Feb 2019 21:01:13 +0000 (22:01 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 17 Feb 2019 21:01:13 +0000 (22:01 +0100)
src/libgame/zip/miniunz.c

index b068486e457ffb190eae8f754e0682fd01ef2106..285d10ed4ecfd3683726a9f9a20d814ce27c561c 100644 (file)
@@ -639,7 +639,14 @@ char **zip_extract(char *filename, char *directory)
 
     int success = (miniunz_extract_all(uf, 0, 1, NULL) == UNZ_OK);
 
-    CHDIR(last_directory);     // change back to previous directory
+    if (CHDIR(last_directory)) // change back to previous directory
+    {
+      debug_printf("Cannot change to directory '%s'!\n", last_directory);
+
+      unzClose(uf);
+
+      return NULL;
+    }
 
     unzClose(uf);