diff --git a/output.cc b/output.cc index ecc59d6d5..708302b48 100644 --- a/output.cc +++ b/output.cc @@ -114,6 +114,8 @@ #include "Target.h" #include "utils.h" +#include + #include #include #include @@ -1528,7 +1530,7 @@ static void printosclassificationoutput(const struct OS_Classification_Results * if (familyno > 0) log_write(LOG_PLAIN, ", "); log_write(LOG_PLAIN, "%s", fullfamily[familyno]); if (*familygenerations[familyno]) log_write(LOG_PLAIN, " %s", familygenerations[familyno]); - if (familyaccuracy[familyno] < 1.0) log_write(LOG_PLAIN, " (%d%%)", (int) (familyaccuracy[familyno] * 100)); + if (familyaccuracy[familyno] < 1.0) log_write(LOG_PLAIN, " (%.f%%)", floor(familyaccuracy[familyno] * 100)); } log_write(LOG_PLAIN, "\n"); } @@ -1656,9 +1658,10 @@ void printosscanoutput(Target *currenths) { free(p); } - log_write(LOG_PLAIN,"Aggressive OS guesses: %s (%d%%)", FPR->prints[0]->OS_name, (int) (FPR->accuracy[0] * 100)); + log_write(LOG_PLAIN,"Aggressive OS guesses: %s (%.f%%)", FPR->prints[0]->OS_name, floor(FPR->accuracy[0] * 100)); for (i = 1; i < 10 && FPR->num_matches > i && FPR->accuracy[i] > FPR->accuracy[0] - 0.10; i++) - log_write(LOG_PLAIN,", %s (%d%%)", FPR->prints[i]->OS_name, (int) (FPR->accuracy[i] * 100)); + log_write(LOG_PLAIN,", %s (%.f%%)", FPR->prints[i]->OS_name, floor(FPR->accuracy[i] * 100)); + log_write(LOG_PLAIN, "\n"); } diff --git a/scan_engine.cc b/scan_engine.cc index ce9c1d537..97095b0ff 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -113,6 +113,7 @@ #include "Target.h" #include "targets.h" #include "utils.h" +#include #include #include @@ -5355,7 +5356,7 @@ void pos_scan(Target *target, u16 *portarray, int numports, stype scantype) { tries++; if (o.debugging) { - log_write(LOG_STDOUT, "Finished round #%d. Current stats: numqueries_ideal: %d; min_width: %d; max_width: %d; packet_incr: %d; senddelay: %dus; fallback: %d%%\n", tries, (int) ss.numqueries_ideal, ss.min_width, ss.max_width, ss.packet_incr, senddelay, (int) (100 * ss.fallback_percent)); + log_write(LOG_STDOUT, "Finished round #%d. Current stats: numqueries_ideal: %d; min_width: %d; max_width: %d; packet_incr: %d; senddelay: %dus; fallback: %.f%%\n", tries, (int) ss.numqueries_ideal, ss.min_width, ss.max_width, ss.packet_incr, senddelay, floor(100 * ss.fallback_percent)); } ss.numqueries_ideal = ss.initial_packet_width;