diff --git a/repl.c b/repl.c index 021a696..5772883 100644 --- a/repl.c +++ b/repl.c @@ -19,6 +19,10 @@ static char *readline(const char *prompt) { } size_t len = strlen(line); + + if (len < 1) + return NULL; + if (line[len - 1] == '\n') { line[len - 1] = '\0'; len -= 1;