From 6ad1c1c257c74c82179a0eb62277ceef1cc4e9e0 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Tue, 31 Jan 2006 23:35:06 +0000 Subject: Sync with internal subversion --- hardinfo2/expr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'hardinfo2/expr.c') 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; -- cgit v1.2.3