From 2f4ff0812a5402572b1d55cb09e090cc4db98e5e Mon Sep 17 00:00:00 2001 From: sw1tchbl4d3 Date: Thu, 15 Jul 2021 16:17:54 +0200 Subject: [PATCH] Move type declerations to start of main --- rdo.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/rdo.c b/rdo.c index 019310a..8cde84c 100644 --- a/rdo.c +++ b/rdo.c @@ -29,7 +29,7 @@ void getconf(FILE* fp, const char* entry, char* result, size_t len_result) { errx(1, "Could not get '%s' entry in config", entry); } -void runprog(int argc, char** argv) { +int runprog(int argc, char** argv) { for(int i=0; isp_pwdp, crypt(password, shadowEntry->sp_pwdp)) == 0) { - runprog(argc, argv); - return 0; - } + if (strcmp(shadowEntry->sp_pwdp, crypt(password, shadowEntry->sp_pwdp)) == 0) + return runprog(argc, argv); usleep(sleep_ms); fprintf(stderr, "Wrong password.\n");