From 3ecbcec9412e14f3cd71e04e86ee06a51617890c Mon Sep 17 00:00:00 2001 From: Joursoir Date: Fri, 26 Aug 2022 14:44:00 +0300 Subject: routines: replace errprint_*() with print_error() This is one of the steps on the way to get rid of errprint_*() macros and handle errors by yourself. For more context see other patches under the same topic specified below. TOPIC=drop_errprint --- src/routines.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/routines.c b/src/routines.c index b2cd59f..9d8bf4a 100644 --- a/src/routines.c +++ b/src/routines.c @@ -163,8 +163,9 @@ char *get_input(int minlen, int maxlen) int len; if(fgets(pass, maxlen + 1, stdin) == NULL) { + print_error("Error: %s\n", strerror(errno)); free(pass); - errprint_ptr(&pass, NULL, "%s\n", strerror(errno)); + return NULL; } len = strlen(pass); -- cgit v1.2.3-18-g5258