aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/expr.c
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2006-01-31 23:35:06 +0000
committerLeandro A. F. Pereira <leandro@hardinfo.org>2006-01-31 23:35:06 +0000
commit6ad1c1c257c74c82179a0eb62277ceef1cc4e9e0 (patch)
tree73a0657cad8a96c0d0611ec900b95adc4a264be0 /hardinfo2/expr.c
parente9906f6d9335ae96cd6afac714646b97edc469a5 (diff)
Sync with internal subversion
Diffstat (limited to 'hardinfo2/expr.c')
-rw-r--r--hardinfo2/expr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hardinfo2/expr.c b/hardinfo2/expr.c
index 2bdd5563..da7c01ad 100644
--- a/hardinfo2/expr.c
+++ b/hardinfo2/expr.c
@@ -133,8 +133,8 @@ gfloat math_postfix_eval(GSList *postfix, gfloat at_value)
gfloat stack[500];
gint sp = 0;
- stack[0] = 0.0;
-
+ memset(stack, 0, sizeof(gfloat) * 500);
+
for (p = postfix; p; p = p->next) {
MathToken *t = (MathToken *) p->data;
@@ -233,7 +233,8 @@ int main(void)
gchar *expr = "0.9*(@+(5.2*0.923+3*(2.0)))";
postfix = math_string_to_postfix(expr);
- g_print("%s = %f (must be 18.71964)\n", expr, math_postfix_eval(postfix, 10));
+ g_print("%s = %f (must be 18.71964)\n", expr,
+ math_postfix_eval(postfix, 10));
math_postfix_free(postfix, TRUE);
return 0;