aboutsummaryrefslogtreecommitdiffstats
path: root/src/classifiers/winnow.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/classifiers/winnow.c')
-rw-r--r--src/classifiers/winnow.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/classifiers/winnow.c b/src/classifiers/winnow.c
index 5775a7997..4b286eb8f 100644
--- a/src/classifiers/winnow.c
+++ b/src/classifiers/winnow.c
@@ -96,7 +96,14 @@ winnow_classify (struct classifier_ctx *ctx, statfile_pool_t *pool, char *statfi
}
g_tree_foreach (input, classify_callback, &data);
- *res = scale * (data.sum / data.count);
+
+ if (data.count != 0) {
+ *res = scale * (data.sum / data.count);
+ }
+ else {
+ *res = 0;
+ }
+
g_hash_table_insert (ctx->results, statfile, res);
}