mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 03:25:07 -05:00
client: indicate truncated addresses/hostnames
Add symbol > to the end of the resolved hostname or address when it's truncated.
This commit is contained in:
5
client.c
5
client.c
@@ -1885,10 +1885,13 @@ format_name(char *buf, int size, int trunc_dns, int ref, uint32_t ref_id,
|
|||||||
snprintf(buf, size, "%s", UTI_IPToString(ip_addr));
|
snprintf(buf, size, "%s", UTI_IPToString(ip_addr));
|
||||||
} else {
|
} else {
|
||||||
DNS_IPAddress2Name(ip_addr, buf, size);
|
DNS_IPAddress2Name(ip_addr, buf, size);
|
||||||
if (size > trunc_dns)
|
if (size > trunc_dns) {
|
||||||
|
if (trunc_dns > 0)
|
||||||
|
buf[trunc_dns - 1] = '>';
|
||||||
buf[trunc_dns] = '\0';
|
buf[trunc_dns] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user