diff options
author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-20 20:39:08 +0900 |
---|---|---|
committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-20 20:39:08 +0900 |
commit | 82b1cce1bc5c91c0b56501f5dab912390206ace5 (patch) | |
tree | ccb0b9b293b6dccfdc95cbd657fb63227274dc41 /src/cli.c | |
parent | 685ec81e127c9409a91299a5ac8415bb94f55ad9 (diff) |
Use cli and gui as shared libraries
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); } |