diff options
author | Luke Bratch <luke@bratch.co.uk> | 2023-04-08 17:36:49 +0200 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2023-04-08 17:36:49 +0200 |
commit | ca8c31cdb180bd5758a4a4f9d868eca31197081c (patch) | |
tree | 3aed35a062e426188642ed8e44a0ab4e8a64a0af /functions.h | |
parent | d151ca51f94be04d8e70f72773e073a471a799de (diff) |
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.
Diffstat (limited to 'functions.h')
-rw-r--r-- | functions.h | 3 |
1 files changed, 2 insertions, 1 deletions
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) |