aboutsummaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cli.c b/src/cli.c
index 902a693..af8522b 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -17,21 +17,28 @@
#include "config.h"
#include <stdlib.h>
+#include <stdio.h>
+#include <limits.h>
#include "_readline.h"
+#include "disp.h"
void init(void) {}
void
display_calc(int x, int y)
{
- printf(prompt, "%d + %d = ", x, y);
+ printf("%d + %d = ", x, y);
}
int
read_input(void)
{
char *txt = readline("");
+
+ if ((!txt) || (*txt == '\0'))
+ return INT_MAX;
+
return atoi(txt);
}