Text   |  XML   |  ReML   |   Visible Warnings:

Redundant Condition  at filter_dlg.c:1318

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

filter_te_syntax_check_cb

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/filter_dlg.c)expand/collapse
Show more  
 1300  filter_te_syntax_check_cb(GtkWidget *w)
 1301  {
 1302      const gchar *strval;
 1303      dfilter_t   *dfp;
 1304      GPtrArray   *depr = NULL;
 1305      gboolean     use_statusbar;
 1306      gchar       *msg;
 1307      guchar       c;
 1308   
 1309      strval = gtk_entry_get_text(GTK_ENTRY(w));
 1310      use_statusbar = g_object_get_data(G_OBJECT(w), E_FILT_FIELD_USE_STATUSBAR_KEY) ? TRUE : FALSE;
 1311   
 1312      if (use_statusbar) {
 1313          statusbar_pop_filter_msg();
 1314      }
 1315   
 1316      /* colorize filter string entry */
 1317      if (g_object_get_data(G_OBJECT(w), E_FILT_FIELD_NAME_ONLY_KEY) &&
 1318          strval && (c = proto_check_field_name(strval)) != 0)
 1319      {
 1320          colorize_filter_te_as_invalid(w);
 1321          if (use_statusbar) {
 1322              msg = g_strdup_printf(" Illegal character in field name: '%c'", c);
 1323              statusbar_push_filter_msg(msg);
 1324              g_free(msg);
 1325          }
 1326      } else if (strval && dfilter_compile(strval, &dfp)) {
 1327          if (dfp != NULL) {
 1328              depr = dfilter_deprecated_tokens(dfp);
 1329              dfilter_free(dfp);
 1330          }
 1331          if (strlen(strval) == 0) {
 1332              colorize_filter_te_as_empty(w);
 1333          } else if (depr) {
 1334              /* You keep using that word. I do not think it means what you think it means. */
 1335              colorize_filter_te_as_deprecated(w);
 1336              if (use_statusbar) {
 1337                  /*
 1338                   * We're being lazy and only printing the first "problem" token.
 1339                   * Would it be better to print all of them?
 1340                   */
 1341                  msg = g_strdup_printf(" \"%s\" may have unexpected results (see the User's Guide)",
 1342                                        (const char *) g_ptr_array_index(depr, 0));
 1343                  statusbar_push_filter_msg(msg);
 1344                  g_free(msg);
 1345              }
 1346          } else {
 1347              colorize_filter_te_as_valid(w);
 1348          }
 1349      } else {
 1350          colorize_filter_te_as_invalid(w);
 1351          if (use_statusbar) {
 1352              statusbar_push_filter_msg(" Invalid filter");
 1353          }
 1354      }
 1355  }
Show more  




Change Warning 4000.30799 : Redundant Condition

Priority:
State:
Finding:
Owner:
Note: