From: Andre Noll Date: Tue, 15 May 2012 21:19:29 +0000 (+0200) Subject: mood: Add score value only for admissible files. X-Git-Tag: v0.4.11~7^2~2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=ec5040e2e7d3c82e93769b62335fab1e63b0f07c;p=paraslash.git 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. --- 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)