Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Redundant Condition  at terminfo-core.c:137

Categories: LANG.STRUCT.RC CWE:570 CWE:571
Warning ID: 7450.28558
Procedure: _move_relative
Trace: view
Modified: Thu Nov 26 11:21:14 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /kat0/fletcher/SATE/2010/irssi-0.8.14/src/fe-text/terminfo-core.c
   Enter _move_relative
 122 static void _move_relative(TERM_REC *term, int oldx, int oldy, int x, int y) 
 123 {
 124         if (oldx == 0 && x == 0 && y == oldy+1) {
 125                 /* move to beginning of next line -
 126                    hope this works everywhere */ 
 127                 tput("\r\n");
 128                 return;
 129         }
 130  
 131         if (oldx > 0 && y == oldy) {
 132                 /* move cursor left/right */ 
 133                 if (x == oldx-1 && term->TI_cub1) {
 134                         tput(tparm(term->TI_cub1));
 135                         return;
 136                 }
Always True: y == oldy137                 if (x == oldx+1 && y == oldy && term->TI_cuf1) {     /* Redundant Condition */
 138                         tput(tparm(term->TI_cuf1));
 139                         return;
 140                 }
 141         }
 142  
 143         /* fallback to absolute positioning */ 
 144         if (term->TI_cup) {
 145                 tput(tparm(term->TI_cup, y, x));
 146                 return;
 147         }
 148  
 149         if (oldy != y)
 150                 tput(tparm(term->TI_vpa, y));
 151         if (oldx != x)
 152                 tput(tparm(term->TI_hpa, x));
 153 } 




Change Warning 7450.28558 : Redundant Condition

Priority:
State:
Finding:
Owner:
Note: