From b252694ce6aafcdec2dd268196029f17ab0c6335 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 19 Oct 2016 02:00:43 -0400 Subject: Shake first round of bugs out of hal_rpc_pkey_match(). The filtering code for this function has not been tested yet. --- ks_flash.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ks_flash.c') diff --git a/ks_flash.c b/ks_flash.c index 9f0a03e..7c96f90 100644 --- a/ks_flash.c +++ b/ks_flash.c @@ -1170,7 +1170,11 @@ static hal_error_t ks_match(hal_ks_t *ks, *result_len = 0; - if ((err = hal_ks_index_find(&db.ksi, previous_uuid, 0, NULL, &i)) != HAL_OK) + err = hal_ks_index_find(&db.ksi, previous_uuid, 0, NULL, &i); + + if (err == HAL_ERROR_KEY_NOT_FOUND) + i--; + else if (err != HAL_OK) return err; while (*result_len < result_max) { -- cgit v1.2.3