From c7cdef5ac71a39df9474bade72ac9276d875a493 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 7 Nov 2021 12:04:18 +0100 Subject: fixed ceil and tidied code --- cmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds.c b/cmds.c index 4884ec8..0ed7b62 100644 --- a/cmds.c +++ b/cmds.c @@ -11,7 +11,7 @@ #define REDUCE stack.val[--stack.count] = 0 stack fceil(stack stack) { - LAST = ceil(PREV); + LAST = ceil(LAST); return stack; } @@ -76,7 +76,7 @@ void init_state(state *s) { } void exec(char *buf, state *s) { - command *c = bsearch(&buf, s->sorted, sizeof(CMD_LIST)/sizeof(s->sorted[0]), sizeof(s->sorted[0]), search); + command *c = bsearch(&buf, s->sorted, s->numel, sizeof(s->sorted[0]), search); if (c == NULL) { fprintf(s->defout, "error: function '%s' not found\n", buf); return; -- cgit 1.4.1-2-gfad0