Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Redundant Condition  at chat-completion.c:735

Categories: LANG.STRUCT.RC CWE:570 CWE:571
Warning ID: 7280.28368
Procedure: sig_erase_complete_msg
Trace: view
Modified: Thu Nov 26 11:09:07 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-common/core/chat-completion.c
   Enter sig_erase_complete_msg
 714 static void sig_erase_complete_msg(WINDOW_REC *window, const char *word,
 715                                    const char *line) 
 716 {
 717         SERVER_REC *server;
 718         MODULE_SERVER_REC *mserver;
 719         GSList *tmp;
 720  
 721         server = line_get_server(line);
 722         if (server == NULL){
 723                 server = window->active_server;
 724                 if (server == NULL)
 725                         return;
 726         }
 727  
 728         if (*word == '\0')
 729                 return;
 730  
 731         /* check from global list */ 
 732         completion_last_message_remove(word);
 733  
 734         /* check from server specific list */ 
Always True: server != (void*)0735         if (server != NULL) {     /* Redundant Condition */
 736                 mserver = MODULE_DATA(server);
 737                 for (tmp = mserver->lastmsgs; tmp != NULL; tmp = tmp->next) {
 738                         LAST_MSG_REC *rec = tmp->data;
 739  
 740                         if (g_strcasecmp(rec->nick, word) == 0) {
 741                                 last_msg_destroy(&mserver->lastmsgs, rec);
 742                                 break;
 743                         }
 744                 }
 745  
 746         }
 747 } 




Change Warning 7280.28368 : Redundant Condition

Priority:
State:
Finding:
Owner:
Note: