config.h must be include before fping.h, because
configure --enable-debug writes the DEBUG #define
to config.h, and the dbg_printf macro definition
requires a defined DEBUG to actually produce any
output.
Unbreaking dbg_printf() exposed an instance of
wrong use, so fix that. Also, add a newline to
the debug output reporting used CPU time.
extern "C" {
#endif /* __cplusplus */
-#include "fping.h"
#include "config.h"
+#include "fping.h"
#include "options.h"
#include "optparse.h"
#if defined(DEBUG) || defined(_DEBUG)
perf_cpu_end = clock();
perf_cpu_time_used = ((double) (perf_cpu_end - perf_cpu_start)) / CLOCKS_PER_SEC;
- printf("[DEBUG] CPU time used: %f sec", perf_cpu_time_used);
+ printf("[DEBUG] CPU time used: %f sec\n", perf_cpu_time_used);
#endif /* DEBUG || _DEBUG */
finish();
/* optionally require reply source equal to target address */
if (check_source_flag && addr_cmp((struct sockaddr *)&response_addr, (struct sockaddr *)&h->saddr)) {
- dbg_printf("discarding reply from wrong source address\n");
+ dbg_printf("%s\n", "discarding reply from wrong source address");
return 1;
}