From 5e40e676a7c4f640c9f850a379300c01a5fca69c Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Tue, 22 Jul 2014 12:59:32 +0100 Subject: [PATCH] Cleanup key array logic to make llvm scan-build happier We can't have the size != 0 without keys != NULL, but the fact we checked one at the start and the other later was confusing the static checks from scan-build. Use size in both places; it keeps scan-build happy and make the code a little easier to read. --- keyarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyarray.c b/keyarray.c index 8bade8c..8293392 100644 --- a/keyarray.c +++ b/keyarray.c @@ -71,7 +71,7 @@ bool array_add(struct keyarray *array, struct openpgp_fingerprint *fp) int curpos = 0; found = false; - if (array->keys != NULL && array->count > 0) { + if (array->size != 0 && array->count > 0) { bottom = -1; top = array->count - 1; while ((top - bottom) > 1) { -- 2.39.2