aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-08-26 14:44:00 +0300
committerJoursoir <chat@joursoir.net>2022-08-26 21:00:50 +0300
commit3ecbcec9412e14f3cd71e04e86ee06a51617890c (patch)
tree3bd99d65d9c1ff6c7bf9b31f909576b0e0394188
parent886d57f5c7d4cdbb0daf252e3aa60a00dd08a9c9 (diff)
downloadlock-password-3ecbcec9412e14f3cd71e04e86ee06a51617890c.tar.gz
lock-password-3ecbcec9412e14f3cd71e04e86ee06a51617890c.tar.bz2
lock-password-3ecbcec9412e14f3cd71e04e86ee06a51617890c.zip
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
-rw-r--r--src/routines.c3
1 files changed, 2 insertions, 1 deletions
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);