1 From 18ca43507b351f339ff23062541ee8d58e813a53 Mon Sep 17 00:00:00 2001
2 From: Florian Forster <ff@octo.it>
3 Date: Sun, 29 Jul 2018 14:34:19 +0200
4 Subject: [PATCH] ping_host_add: Decrease buffer size to make GCC's truncation
9 src/liboping.c | 6 ++----
10 1 file changed, 2 insertions(+), 4 deletions(-)
12 diff --git a/src/liboping.c b/src/liboping.c
13 index 5253e8c..2470988 100644
16 @@ -1636,10 +1636,8 @@ int ping_host_add (pingobj_t *obj, const char *host)
20 - char errmsg[PING_ERRMSG_LEN];
22 - snprintf (errmsg, PING_ERRMSG_LEN, "Unknown `ai_family': %i", ai_ptr->ai_family);
23 - errmsg[PING_ERRMSG_LEN - 1] = '\0';
25 + snprintf (errmsg, sizeof(errmsg), "Unknown `ai_family': %d", ai_ptr->ai_family);
27 dprintf ("%s", errmsg);
28 ping_set_error (obj, "getaddrinfo", errmsg);