diff options
Diffstat (limited to 'ks_volatile.c')
-rw-r--r-- | ks_volatile.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ks_volatile.c b/ks_volatile.c index 2e6ea3e..c416263 100644 --- a/ks_volatile.c +++ b/ks_volatile.c @@ -414,10 +414,7 @@ static hal_error_t ks_match(hal_ks_t *ks, else if (err != HAL_OK) return err; - while (*result_len < result_max) { - - if (++i >= ksv->db->ksi.used) - return HAL_OK; + while (*result_len < result_max && ++i < ksv->db->ksi.used) { unsigned b = ksv->db->ksi.index[i]; @@ -466,7 +463,7 @@ static hal_error_t ks_match(hal_ks_t *ks, ++*result_len; } - return HAL_ERROR_RESULT_TOO_LONG; + return HAL_OK; } static hal_error_t ks_set_attribute(hal_ks_t *ks, |