eppic/eppic-Fix-eppic_getnxtfct.patch

26 lines
853 B
Diff
Raw Normal View History

From: Petr Tesarik <petr@tesarici.cz>
Date: Thu, 13 Apr 2023 11:54:25 +0200
Subject: Fix name length condition in eppic_getnxtfct()
Upstream: sent, https://github.com/lucchouina/eppic/pull/9
Comparisons like 'A > B > C' do not have their mathematical meaning.
Instead, 'MAX_SYMNAMELEN-5 > l' evaluates to 0 or 1, which is never
greater than 5, and the condition is always false.
---
libeppic/eppic_func.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libeppic/eppic_func.c b/libeppic/eppic_func.c
index 7912b34..b0a73c7 100644
--- a/libeppic/eppic_func.c
+++ b/libeppic/eppic_func.c
@@ -776,7 +776,7 @@ eppic_getnxtfct(void)
int l=strlen(nxtfunc->name);
- if(MAX_SYMNAMELEN-5 > l > 5 ) {
+ if(MAX_SYMNAMELEN-5 > l && l > 5 ) {
if(!strcmp(nxtfunc->name+l-5, "_help")) {