From 6a758105bb815dd5a860bbd7486b6ad8da09eeca Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Sat, 15 Jun 2019 16:03:16 +0800 Subject: [PATCH] Fix typo in error msg creation Prevent typo while generating such kind of logs: "[ERROR] 0 targets did not complete" "1 of 1 target completed, 0 valid passwords found" --- hydra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hydra.c b/hydra.c index 288712b..51dc65c 100644 --- a/hydra.c +++ b/hydra.c @@ -4033,7 +4033,7 @@ int main(int argc, char *argv[]) { printf("%d of %d target%s%scompleted, %lu valid password", hydra_brains.targets - j - k - error, hydra_brains.targets, hydra_brains.targets == 1 ? " " : "s ", hydra_brains.found > 0 ? "successfully " : "", hydra_brains.found); - printf("%s", hydra_brains.found == 1 ? "" : "s"); + printf("%s", hydra_brains.found < 1 ? "" : "s"); printf(" found\n"); error += j; @@ -4090,7 +4090,7 @@ int main(int argc, char *argv[]) { error = 1; } if (error) { - snprintf(tmp_str, STRMAX, "[ERROR] %d target%s did not complete", j, j == 1 ? "" : "s"); + snprintf(tmp_str, STRMAX, "[ERROR] %d target%s did not complete", j, j < 1 ? "" : "s"); fprintf(stderr, "%s\n", tmp_str); if (*json_error) { strncat(json_error,", ", STRMAX);