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"
This commit is contained in:
David Maciejak 2019-06-15 16:03:16 +08:00 committed by GitHub
commit 6a758105bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4033,7 +4033,7 @@ int main(int argc, char *argv[]) {
printf("%d of %d target%s%scompleted, %lu valid password", 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.targets - j - k - error, hydra_brains.targets, hydra_brains.targets == 1 ? " " : "s ",
hydra_brains.found > 0 ? "successfully " : "", hydra_brains.found); 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"); printf(" found\n");
error += j; error += j;
@ -4090,7 +4090,7 @@ int main(int argc, char *argv[]) {
error = 1; error = 1;
} }
if (error) { 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); fprintf(stderr, "%s\n", tmp_str);
if (*json_error) { if (*json_error) {
strncat(json_error,", ", STRMAX); strncat(json_error,", ", STRMAX);