liblo. Fix build with gcc >= 8

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
Andreas Müller
2018-07-01 18:17:03 +02:00
parent bd2f7c7e8b
commit 1d5c7091b8
2 changed files with 40 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
From 74621a7d961b792fb5a9399b6f40ef633ebc5339 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Sun, 1 Jul 2018 18:10:10 +0200
Subject: [PATCH] Fix build with GCC >= 8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
| ../../liblo-0.29/src/server.c:324:13: error: 'strncpy' specified bound 1024 equals destination size [-Werror=stringop-truncation]
| strncpy(hostname, he->h_name, sizeof(hostname));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| cc1: all warnings being treated as errors
Upstream-Status: Pending
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
src/server.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/server.c b/src/server.c
index 01fa08f..e94a453 100644
--- a/src/server.c
+++ b/src/server.c
@@ -321,7 +321,7 @@ void lo_server_resolve_hostname(lo_server s)
gethostname(hostname, sizeof(hostname));
he = gethostbyname(hostname);
if (he) {
- strncpy(hostname, he->h_name, sizeof(hostname));
+ strncpy(hostname, he->h_name, sizeof(hostname)-1);
}
}
--
2.14.4

View File

@@ -5,6 +5,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
inherit autotools pkgconfig
SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${PV}/${BPN}-${PV}.tar.gz"
SRC_URI = " \
${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
file://0001-Fix-build-with-GCC-8.patch \
"
SRC_URI[md5sum] = "b0e70bc0fb2254addf94adddf85cffd3"
SRC_URI[sha256sum] = "ace1b4e234091425c150261d1ca7070cece48ee3c228a5612d048116d864c06a"