summary refs log tree commit diff
path: root/src/zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/zip.c')
-rw-r--r--src/zip.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/zip.c b/src/zip.c
index aca980d..76820b5 100644
--- a/src/zip.c
+++ b/src/zip.c
@@ -39,7 +39,9 @@ struct zip_file *zip_index(char *const restrict file, size_t const size, int *co
 	// find and verify the footer
 	struct zip_footer *footer = zip_find_footer(file, size, &err);
 	if (footer == NULL) {
-		error && (*error = err);
+		if (error) {
+			*error = err;
+		}
 		return NULL;
 	}
 	
@@ -47,7 +49,9 @@ struct zip_file *zip_index(char *const restrict file, size_t const size, int *co
 	struct zip_file *headers = malloc(sizeof (*headers) + footer->headers_no * sizeof (*headers->files));
 	err = index_zip(headers->files, file, footer);
 	if (err) {
-		error && (*error = err);
+		if (error) {
+			*error = err;
+		}
 		free(headers);
 		return NULL;
 	}