summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--extra/expr.y5
-rw-r--r--extra/ifalive.h6
m---------grecs0
3 files changed, 9 insertions, 2 deletions
diff --git a/extra/expr.y b/extra/expr.y
index 098fc3e..d7e9957 100644
--- a/extra/expr.y
+++ b/extra/expr.y
@@ -139,6 +139,7 @@ expr_binop_comp(struct expr_node *a, struct expr_node *b,
}
void yyerror(char const *s);
+int yylex (void);
static struct expr_node *parse_tree;
%}
@@ -408,8 +409,8 @@ expr_eval(int argc, char **argv, IFSTAT a, IFSTAT b)
lex_init(argc, argv);
if (yyparse())
exit(1);
- memcpy(env.stat[0], a, sizeof a);
- memcpy(env.stat[1], b, sizeof b);
+ memcpy(env.stat[0], a, IFSTAT_SIZE);
+ memcpy(env.stat[1], b, IFSTAT_SIZE);
node_eval(parse_tree, &env, &res);
return res.v_bool;
}
diff --git a/extra/ifalive.h b/extra/ifalive.h
index da070fa..127885e 100644
--- a/extra/ifalive.h
+++ b/extra/ifalive.h
@@ -25,4 +25,10 @@ enum {
};
typedef uintmax_t IFSTAT[MAX_STATS];
+#define IFSTAT_SIZE (sizeof(uintmax_t) * MAX_STATS)
int expr_eval(int argc, char **argv, IFSTAT a, IFSTAT b);
+
+void error(int ec, char const *fmt, ...);
+void lex_init(int argc, char **argv);
+
+
diff --git a/grecs b/grecs
-Subproject b06fb7d30415eec1d2efb39286ab96070c724fd
+Subproject 893d875a4065acb757fef55876c391b1dd07004

Return to:

Send suggestions and report system problems to the System administrator.