From 82b1cce1bc5c91c0b56501f5dab912390206ace5 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Thu, 20 Jun 2024 20:39:08 +0900 Subject: Use cli and gui as shared libraries --- src/cli.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/cli.c') 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 +#include +#include #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); } -- cgit v1.2.3