fix: print to be coherent with inetutils2.0

This commit is contained in:
2025-12-16 06:14:38 -06:00
parent 120dacd029
commit ce83f4b54b

View File

@@ -27,16 +27,16 @@ void print_err(const char *format, ...)
void print_header(const struct setting *settings)
{
printf("PING %s (%s) %zu(%zu) bytes of data",
printf("PING %s (%s): %zu data bytes",
settings->dest.hostname,
settings->dest.ipstr,
settings->payload_size,
settings->payload_size + sizeof(struct icmphdr) + sizeof(struct iphdr)
settings->payload_size
);
if (settings->verbose)
{
unsigned short pid = getpid();
printf(", id 0x%x = %d", htons(getpid()), pid);
unsigned short s_pid = htons(getpid());
printf(", id 0x%02x%02x = %d", s_pid & 0xFF, (s_pid>>8) & 0xFF, pid);
}
printf("\n");
}