net-misc/netstat-nat: fix modern C issues

Closes: https://bugs.gentoo.org/875149
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2023-05-11 04:14:56 +01:00
parent 47e1606ad0
commit e4ed427a24
3 changed files with 26 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,5 @@
bin_PROGRAMS = netstat-nat
netstat_nat_SOURCES = netstat-nat.c netstat-nat.h
-docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
doc_DATA = NEWS README ChangeLog AUTHORS
dist_man_MANS = netstat-nat.1
EXTRA_DIST = netstat-nat.spec

View File

@@ -0,0 +1,13 @@
https://bugs.gentoo.org/875149
--- a/netstat-nat.h
+++ b/netstat-nat.h
@@ -64,6 +64,9 @@ void ip_addresses_add(struct _ip_addresses **list, const char *dev, const char *
int ip_addresses_search(struct _ip_addresses *list, const char *ip);
void ip_addresses_free(struct _ip_addresses **list);
+int string_search(char *string, char *search);
+int search_first_hit(char *search, char *line, char *ret);
+int search_sec_hit(char *search, char *line, char *ret);
#define strcopy(dst, dst_size, src) \
strncpy(dst, src, (dst_size - 1));

View File

@@ -1,7 +1,7 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit autotools
@@ -15,6 +15,8 @@ KEYWORDS="amd64 ~arm ppc sparc x86"
PATCHES=(
"${FILESDIR}"/${P}-install.patch
"${FILESDIR}"/${P}-modern-c.patch
"${FILESDIR}"/${P}-docdir.patch
)
src_prepare() {