diff options
Diffstat (limited to 'src/cli.c')
-rw-r--r-- | src/cli.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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); } |