Commit d69bcdf7cbe646a8ad22a81f8665f3bd2e39e189

Stefan Sperling 2019-06-28T19:44:24

compare pointer against NULL, not 0

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/repository.c b/lib/repository.c
index 3e583b2..34d0da4 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -685,7 +685,7 @@ got_repo_search_packidx(struct got_packidx **packidx, int *idx,
 	err = got_error_no_obj(id);
 done:
 	free(path_packdir);
-	if (packdir && closedir(packdir) != 0 && err == 0)
+	if (packdir && closedir(packdir) != 0 && err == NULL)
 		err = got_error_from_errno("closedir");
 	return err;
 }