From 1f134e445c8aeadc312c34432505d900a958de68 Mon Sep 17 00:00:00 2001 From: Anders Iver Gjermo Date: Sun, 23 Feb 2014 02:06:57 +0100 Subject: [PATCH] catch NULL input in interpreter_chat_mode --- interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface.c b/interface.c index 3f2067d..a7b468c 100644 --- a/interface.c +++ b/interface.c @@ -560,7 +560,8 @@ void work_modifier (const char *s, int l) { void interpreter_chat_mode (char *line) { - if (!strncmp (line, "/exit", 5) || !strncmp (line, "/quit", 5)) { + if (line == NULL || /* EOF received */ + !strncmp (line, "/exit", 5) || !strncmp (line, "/quit", 5)) { in_chat_mode = 0; update_prompt (); return;