about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDaniel <steew0x8@protonmail.com>2021-11-07 12:04:18 +0100
committerDaniel <steew0x8@protonmail.com>2021-11-07 12:04:18 +0100
commitc7cdef5ac71a39df9474bade72ac9276d875a493 (patch)
tree69030f1712407efaaf31ceb7eb514caf6c44e845
parentbd5f44ae610514e159f3320b3353faec19247769 (diff)
downloadrpncalc-c7cdef5ac71a39df9474bade72ac9276d875a493.tar.gz
fixed ceil and tidied code
-rw-r--r--cmds.c4
1 files 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;