Text   |  XML   |  ReML   |   Visible Warnings:

Redundant Condition  at gtp_stat.c:181

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

gtk_gtpstat_init

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/gtp_stat.c)expand/collapse
Show more  
 151  gtk_gtpstat_init(const char *optarg, void *userdata _U_)
 152  {
 153          gtpstat_t *gtp;
 154          const char *filter=NULL;
 155          GtkWidget *label;
 156          char *filter_string;
 157          GString *error_string;
 158          GtkWidget *vbox;
 159          GtkWidget *bbox;
 160          GtkWidget *close_bt;
 161   
 162          if(!strncmp(optarg,"gtp,",4)){
 163                  filter=optarg+4;
 164          } else {
 165                  filter="gtp"; /*NULL doesn't work here like in LDAP. Too little time/lazy to find out why ?*/
 166          }
 167   
 168          gtp=g_malloc(sizeof(gtpstat_t));
 169   
 170          gtp->win=window_new(GTK_WINDOW_TOPLEVEL, "gtp-stat");
 171          gtk_window_set_default_size(GTK_WINDOW(gtp->win), 550, 400);
 172          gtpstat_set_title(gtp);
 173   
 174          vbox=gtk_vbox_new(FALSE, 3);
 175          gtk_container_add(GTK_CONTAINER(gtp->win), vbox);
 176          gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
 177   
 178          label=gtk_label_new("GTP Service Response Time statistics");
 179          gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 180   
 181          filter_string = g_strdup_printf("Filter: %s", filter ? filter : "");
 182          label=gtk_label_new(filter_string);
 183          g_free(filter_string);
 184          gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
 185          gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 186   
 187          label=gtk_label_new("GTP Requests");
 188          gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 189   
 190          /* We must display TOP LEVEL Widget before calling init_srt_table() */
 191          gtk_widget_show_all(gtp->win);
 192   
 193          init_srt_table(&gtp->gtp_srt_table, 4, vbox, NULL);
 194          init_srt_table_row(&gtp->gtp_srt_table, 0, "Echo");
 195          init_srt_table_row(&gtp->gtp_srt_table, 1, "Create PDP context");
 196          init_srt_table_row(&gtp->gtp_srt_table, 2, "Update PDP context");
 197          init_srt_table_row(&gtp->gtp_srt_table, 3, "Delete PDP context");
 198   
 199          error_string=register_tap_listener("gtp", gtp, filter, gtpstat_reset, gtpstat_packet, gtpstat_draw);
 200          if(error_string){
 201                  simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
 202                  g_string_free(error_string, TRUE);
 203                  g_free(gtp);
 204                  return;
 205          }
 206   
 207          /* Button row. */
 208          bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
 209          gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
 210   
 211          close_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE);
 212          window_set_cancel_button(gtp->win, close_bt, window_cancel_button_cb);
 213   
 214          g_signal_connect(gtp->win, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
 215          g_signal_connect(gtp->win, "destroy", G_CALLBACK(win_destroy_cb), gtp);
 216   
 217          gtk_widget_show_all(gtp->win);
 218          window_present(gtp->win);
 219   
 220          cf_retap_packets(&cfile, FALSE);
 221          gdk_window_raise(gtp->win->window);
 222  }
Show more  




Change Warning 4362.30874 : Redundant Condition

Priority:
State:
Finding:
Owner:
Note: