net-wireless/wepattack: fix modern C issues

Closes: https://bugs.gentoo.org/881007
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2023-05-11 04:23:41 +01:00
parent e4ed427a24
commit ba0f1a99d4
2 changed files with 46 additions and 9 deletions

View File

@@ -0,0 +1,33 @@
https://bugs.gentoo.org/881007
--- a/src/log.c
+++ b/src/log.c
@@ -25,6 +25,7 @@
#include "log.h"
#include "wepattack.h"
#include "config.h"
+#include "misc.h"
static time_t start_time;
char logfile[40];
--- a/src/misc.c
+++ b/src/misc.c
@@ -23,6 +23,7 @@
#include "wepattack.h"
#include "config.h"
#include "misc.h"
+#include "log.h"
double difftime_us(struct timeval *time_start, struct timeval *time_end) {
@@ -87,8 +88,10 @@ d_fprintf (FILE *__restrict __stream,
__const char *__restrict __format,...) {
if (DEBUG) {
- fprintf(__stream, __format);
+ return fprintf(__stream, __format);
}
+
+ return 0;
}
void print_hex_array(FILE* out, unsigned char* data, int length) {

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -17,21 +17,24 @@ KEYWORDS="amd64 x86"
IUSE="john"
DEPEND="
dev-libs/openssl:0=
dev-libs/openssl:=
net-libs/libpcap
sys-libs/zlib
"
RDEPEND="${DEPEND}
john? ( || (
app-crypt/johntheripper
app-crypt/johntheripper-jumbo
RDEPEND="
${DEPEND}
john? (
|| (
app-crypt/johntheripper
app-crypt/johntheripper-jumbo
)
)"
)
"
PATCHES=(
"${FILESDIR}"/${P}-filter-mac-address.patch
"${FILESDIR}"/${P}-missed-string.h-warnings-fix.patch
"${FILESDIR}"/${P}-modern-c.patch
)
src_prepare() {
@@ -55,11 +58,12 @@ src_compile() {
}
src_install() {
dodoc README
dobin src/wepattack
if use john; then
dosbin run/wepattack_{inc,word}
insinto /etc
doins "${FILESDIR}"/wepattack.conf
fi
dodoc README
}