On Thu, 11 May 2017 08:32:05 +0300, [email protected] wrote:

> Hi!� Please look [this code
> fragment](https://github.com/openbsd/src/blob/14a309e3a4feb469e2b128b77f1f214
> 4a55b1bbb/usr.bin/tic/dump_entry.c#L296):```
> 
> #define FNKEY(i)    (((i)<= 65 && (i)>= 75) || ((i)<= 216 && (i)>= 268))
> 
> ```i can't be less than 65 and more than 75 at the same time� ```This
> possible defect found by
> [AppChecker](https://npo-echelon.ru/en/solutions/appchecker.php)

If you examing the defines in term.h it is obvious that this is a
typo.  The correct test is as follows:

 - todd

Index: usr.bin/tic/dump_entry.c
===================================================================
RCS file: /cvs/src/usr.bin/tic/dump_entry.c,v
retrieving revision 1.19
diff -u -p -u -r1.19 dump_entry.c
--- usr.bin/tic/dump_entry.c    12 Jan 2010 23:22:14 -0000      1.19
+++ usr.bin/tic/dump_entry.c    11 May 2017 18:57:01 -0000
@@ -293,7 +293,7 @@ dump_predicate(PredType type, PredIdx id
 static void set_obsolete_termcaps(TERMTYPE *tp);
 
 /* is this the index of a function key string? */
-#define FNKEY(i)       (((i)<= 65 && (i)>= 75) || ((i)<= 216 && (i)>= 268))
+#define FNKEY(i)       (((i)>= 65 && (i)<= 75) || ((i)>= 216 && (i)<= 268))
 
 /*
  * If we configure with a different Caps file, the offsets into the arrays

Reply via email to