]> git.ipfire.org Git - ipfire-3.x.git/blob - liboping/patches/ping_host_add-Decrease-buffer-size-to-make-GCC-s-truncation-check-happy.patch
lm-sensors: Proper use compiler and linker flags during build time
[ipfire-3.x.git] / liboping / patches / ping_host_add-Decrease-buffer-size-to-make-GCC-s-truncation-check-happy.patch
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
5 check happy.
6
7 Fixes: #38
8 ---
9 src/liboping.c | 6 ++----
10 1 file changed, 2 insertions(+), 4 deletions(-)
11
12 diff --git a/src/liboping.c b/src/liboping.c
13 index 5253e8c..2470988 100644
14 --- a/src/liboping.c
15 +++ b/src/liboping.c
16 @@ -1636,10 +1636,8 @@ int ping_host_add (pingobj_t *obj, const char *host)
17 }
18 else
19 {
20 - char errmsg[PING_ERRMSG_LEN];
21 -
22 - snprintf (errmsg, PING_ERRMSG_LEN, "Unknown `ai_family': %i", ai_ptr->ai_family);
23 - errmsg[PING_ERRMSG_LEN - 1] = '\0';
24 + char errmsg[64];
25 + snprintf (errmsg, sizeof(errmsg), "Unknown `ai_family': %d", ai_ptr->ai_family);
26
27 dprintf ("%s", errmsg);
28 ping_set_error (obj, "getaddrinfo", errmsg);