summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2018-08-28 18:58:25 +0200
committerThomas Deutschmann <whissi@gentoo.org>2018-08-28 18:59:41 +0200
commit13c93be34bcf32350b94c0093d85cbf59788122e (patch)
treebe3ae037fc75e393a0bf0d4b8c301d45ee2c905b
parentapp-text/calibre: remove unRAR license (diff)
downloadgentoo-13c93be34bcf32350b94c0093d85cbf59788122e.tar.gz
gentoo-13c93be34bcf32350b94c0093d85cbf59788122e.tar.bz2
gentoo-13c93be34bcf32350b94c0093d85cbf59788122e.zip
net-libs/liboping: fix building with GCC8
Package-Manager: Portage-2.3.48, Repoman-2.3.10 RepoMan-Options: --force
-rw-r--r--net-libs/liboping/files/liboping-1.10.0-gcc8-fix.patch28
-rw-r--r--net-libs/liboping/liboping-1.10.0-r1.ebuild (renamed from net-libs/liboping/liboping-1.10.0.ebuild)1
2 files changed, 29 insertions, 0 deletions
diff --git a/net-libs/liboping/files/liboping-1.10.0-gcc8-fix.patch b/net-libs/liboping/files/liboping-1.10.0-gcc8-fix.patch
new file mode 100644
index 000000000000..a7b3a3edd1c8
--- /dev/null
+++ b/net-libs/liboping/files/liboping-1.10.0-gcc8-fix.patch
@@ -0,0 +1,28 @@
+From 18ca43507b351f339ff23062541ee8d58e813a53 Mon Sep 17 00:00:00 2001
+From: Florian Forster <ff@octo.it>
+Date: Sun, 29 Jul 2018 14:34:19 +0200
+Subject: [PATCH] ping_host_add: Decrease buffer size to make GCC's truncation
+ check happy.
+
+Fixes: #38
+---
+ src/liboping.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/liboping.c b/src/liboping.c
+index 5253e8c..2470988 100644
+--- a/src/liboping.c
++++ b/src/liboping.c
+@@ -1636,10 +1636,8 @@ int ping_host_add (pingobj_t *obj, const char *host)
+ }
+ else
+ {
+- char errmsg[PING_ERRMSG_LEN];
+-
+- snprintf (errmsg, PING_ERRMSG_LEN, "Unknown `ai_family': %i", ai_ptr->ai_family);
+- errmsg[PING_ERRMSG_LEN - 1] = '\0';
++ char errmsg[64];
++ snprintf (errmsg, sizeof(errmsg), "Unknown `ai_family': %d", ai_ptr->ai_family);
+
+ dprintf ("%s", errmsg);
+ ping_set_error (obj, "getaddrinfo", errmsg);
diff --git a/net-libs/liboping/liboping-1.10.0.ebuild b/net-libs/liboping/liboping-1.10.0-r1.ebuild
index 8f0bc99aa447..50dc00c8fb46 100644
--- a/net-libs/liboping/liboping-1.10.0.ebuild
+++ b/net-libs/liboping/liboping-1.10.0-r1.ebuild
@@ -19,6 +19,7 @@ RDEPEND=${DEPEND}
PATCHES=(
"${FILESDIR}/${PN}-1.6.2-nouidmagic.patch"
+ "${FILESDIR}"/${P}-gcc8-fix.patch
)
src_prepare() {