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 b068486..285d10e 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);