From ec5040e2e7d3c82e93769b62335fab1e63b0f07c Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 15 May 2012 23:19:29 +0200 Subject: [PATCH] mood: Add score value only for admissible files. mood.c:175:3: warning: Value stored to 'ret' is never read ret = get_item_score(item, &afsi, &afhi, path, &item_score, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This time scan-build found a real bug. --- mood.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mood.c b/mood.c index f580400d..d12bc20d 100644 --- a/mood.c +++ b/mood.c @@ -173,6 +173,8 @@ static int compute_mood_score(const struct osl_row *aft_row, struct mood *m, list_for_each_entry(item, &m->score_list, mood_item_node) { ret = get_item_score(item, &afsi, &afhi, path, &item_score, &score_arg_sum); + if (ret == 0) + continue; score += item_score; } if (score_arg_sum) -- 2.39.5