s390utils/0071-cpuplugd-Fix-incorrect-multiplication-in-rules-evalu.patch

29 lines
992 B
Diff
Raw Normal View History

From 07e1c6ff7f6deb2c35c436c5d5def61e6aac32ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 5 Apr 2011 14:52:24 +0200
Subject: [PATCH] cpuplugd: Fix incorrect multiplication in rules evaluation
Description: cpuplugd: Fix incorrect multiplication in rules evaluation
Symptom: Rules don't evaluate correctly when multiplication (*) is used.
Problem: Missing return statement in switch/case block.
Solution: Add return statement.
---
cpuplugd/terms.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/cpuplugd/terms.c b/cpuplugd/terms.c
index 0d08e9e..2371efa 100644
--- a/cpuplugd/terms.c
+++ b/cpuplugd/terms.c
@@ -339,6 +339,7 @@ static double eval_double(struct term *fn, struct symbols *symbols)
a = eval_double(fn->left, symbols);
b = eval_double(fn->right, symbols);
sum = a*b;
+ return sum;
/*return eval_double(fn->left, symbols) *
eval_double(fn->right, symbols);*/
case OP_DIV:
--
1.7.4