From ca8c31cdb180bd5758a4a4f9d868eca31197081c Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sat, 8 Apr 2023 17:36:49 +0200 Subject: Improve stdin handling (only available when running in foreground mode) - don't get stuck in a loop when handling EOF/^D/Ctrl+D, improve debug output, improve comments, initialise variables more safely, exit main loop on errors. --- functions.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'functions.h') diff --git a/functions.h b/functions.h index 5799aa6..30ae4e4 100644 --- a/functions.h +++ b/functions.h @@ -62,7 +62,8 @@ // Debug is only written if the global int "debug" is greater than or equal to the level. void debugprint(int level, char *format, ...); -// Get stdin line with buffer overrun protection +// Get stdin line with buffer overrun protection. +// Returns OK, NO_INPUT, or TOO_LONG as appropriate. int getstdin(char *prompt, char *buff, size_t sz); // Append CR-LF to the end of a string (after cleaning up any existing trailing CR or LF) -- cgit v1.2.3