]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
client: indicate truncated addresses/hostnames
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 19 Jul 2016 13:37:23 +0000 (15:37 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 20 Jul 2016 07:34:11 +0000 (09:34 +0200)
Add symbol > to the end of the resolved hostname or address when it's
truncated.

client.c

index e974062c5b21e514764c541c484f711f2a76fab4..8021f6a6ee1791a87358662a3d1fdc342b3d01eb 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1885,8 +1885,11 @@ format_name(char *buf, int size, int trunc_dns, int ref, uint32_t ref_id,
     snprintf(buf, size, "%s", UTI_IPToString(ip_addr));
   } else {
     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';
+    }
   }
 }