media-radio/tlf: Fix failig test (bug #740298)

Thanks ago for reporting

Closes: https://bugs.gentoo.org/740298
Package-Manager: Portage-3.0.6, Repoman-3.0.1
Signed-off-by: Thomas Beierlein <tomjbe@gentoo.org>
This commit is contained in:
Thomas Beierlein
2020-09-13 17:57:17 +02:00
parent 96f7aaaee4
commit 7a5ea90f63
2 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
diff --git a/src/zone_nr.c b/src/zone_nr.c
index c7e2a33..805bd4e 100644
--- a/src/zone_nr.c
+++ b/src/zone_nr.c
@@ -20,11 +20,14 @@
* get zone number
*
*--------------------------------------------------------------*/
-
+#include "string.h"
int zone_nr(char *comment) {
int z = 0;
+ if (strlen(comment) < 2)
+ return z;
+
if (comment[0] <= 57 && comment[0] >= 48)
z = (comment[0] - 48) * 10;
if (comment[1] <= 57 && comment[1] >= 48)

View File

@@ -25,6 +25,8 @@ DEPEND="
${RDEPEND}
test? ( dev-util/cmocka )"
PATCHES=( "${FILESDIR}"/${P}-zone_nr.patch )
src_configure() {
append-ldflags -L/usr/$(get_libdir)/hamlib
econf --enable-fldigi-xmlrpc