app-admin/procinfo-ng: fix build w/ clang, -Wformat-security

It's a lazy fix but upstream is dead and surprisingly other
distros still package this. Fix -Wformat-security while at it.

Closes: https://bugs.gentoo.org/719790
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2022-11-10 04:57:16 +00:00
parent 83b8c1aa90
commit a4ae230be0
2 changed files with 24 additions and 4 deletions

View File

@@ -0,0 +1,11 @@
--- a/procinfo.cpp
+++ b/procinfo.cpp
@@ -211,7 +211,7 @@ int mainLoop(bool perSecond, bool showTotals, bool showTotalsMem, bool fullScree
try {
rows = getNetStats(perSecond, showTotals, skipIfaces, elapsed);
} catch (string exceptionMessage) {
- print(exceptionMessage.c_str());
+ print("%s", exceptionMessage.c_str());
}
print("\n");
prettyPrint(rows, rowWidth, true);

View File

@@ -1,9 +1,9 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit autotools
inherit autotools flag-o-matic
DESCRIPTION="Completely rewrite of the old system monitoring app procinfo"
HOMEPAGE="https://sourceforge.net/projects/procinfo-ng/"
@@ -13,17 +13,26 @@ LICENSE="|| ( GPL-2 LGPL-2.1 )"
SLOT="0"
KEYWORDS="amd64 ~hppa x86"
RDEPEND="sys-libs/ncurses:0="
RDEPEND="sys-libs/ncurses:="
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"
PATCHES=(
"${FILESDIR}"/${P}-autotools.patch
"${FILESDIR}"/${P}-man.patch
"${FILESDIR}"/${P}-wformat-security.patch
)
src_prepare() {
default
mv configure.{in,ac} || die
eautoreconf
}
src_configure() {
# bug #719790
append-cxxflags -std=c++03
default
}