diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2012-06-18 20:15:42 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2012-06-18 20:15:42 +0000 |
commit | fc881f6f372d6d00ce85ecf3168e00bd76707408 (patch) | |
tree | fa77ea6328785edeb159d782fd367096f77d631d | |
parent | 6d06c682470caf311e04862d65549f3c40a6604c (diff) |
Fix r43338
svn path=/trunk/; revision=43339
-rw-r--r-- | ui/gtk/packet_list_store.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/ui/gtk/packet_list_store.c b/ui/gtk/packet_list_store.c index 328f71b368..19b1dc8ab6 100644 --- a/ui/gtk/packet_list_store.c +++ b/ui/gtk/packet_list_store.c @@ -714,26 +714,22 @@ packet_list_change_record(PacketList *packet_list, guint row, gint col, column_i case COL_EXPERT: case COL_FREQ_CHAN: if (cinfo->col_data[col] && cinfo->col_data[col] != cinfo->col_buf[col]) { - col_text_len = strlen(record->col_text[col]); - if (col_text_len > G_MAXUSHORT) - col_text_len = G_MAXUSHORT; - /* This is a constant string, so we don't have to copy it */ record->col_text[col] = (gchar *) cinfo->col_data[col]; - record->col_text_len[col] = (gushort) col_text_len; #ifdef NEW_PACKET_LIST_STATISTICS ++packet_list->const_strings; #endif + + col_text_len = strlen(record->col_text[col]); + if (col_text_len > G_MAXUSHORT) + col_text_len = G_MAXUSHORT; + + record->col_text_len[col] = (gushort) col_text_len; break; } /* !! FALL-THROUGH!! */ default: - col_text_len = strlen(cinfo->col_data[col]); - if (col_text_len > G_MAXUSHORT) - col_text_len = G_MAXUSHORT; - record->col_text_len[col] = (gushort) col_text_len; - if (!record->col_text_len[col]) { record->col_text[col] = ""; #ifdef NEW_PACKET_LIST_STATISTICS @@ -751,6 +747,11 @@ packet_list_change_record(PacketList *packet_list, guint row, gint col, column_i str = g_string_chunk_insert_const (packet_list->string_pool, (const gchar *)cinfo->col_data[col]); } record->col_text[col] = str; + + col_text_len = strlen(record->col_text[col]); + if (col_text_len > G_MAXUSHORT) + col_text_len = G_MAXUSHORT; + record->col_text_len[col] = (gushort) col_text_len; break; } } |