summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-09-27 13:14:04 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-09-27 13:14:04 +0000
commit33cefd65ec6bf22bc1d1bd4f708876b54596c886 (patch)
treec2efb1f2f3d9e4cf3cd6ad915c8f5de3c2c8d701
parent04c7b4836d733af92d23c134a80ce2388da94b7c (diff)
downloadwireshark-33cefd65ec6bf22bc1d1bd4f708876b54596c886.tar.gz
Copy over:
Revision 43616 - Grab-bag of unused variables. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7452 ------------------------------------------------------------------------------ Revision 43617 - Fix leaks - don't g_strdup a string just to use it in a g_strdup_printf - clean up properly in error cases in lua bindings - misc. other missing g_free() calls - one missing fclose() in the new 80211_utils https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7454 ------------------------------------------------------------------------------ Revision 45146 - Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5016 - No markers show up when maps are displayed. #BACKPORT(1.8, 1.6) Revision 45148 - Revision 45146 fixed only the first map. This patch fixes all maps. #BACKPORT(1.6, 1.8) svn path=/trunk-1.8/; revision=45173
-rw-r--r--epan/dissectors/packet-rdp.c14
-rw-r--r--epan/dissectors/packet-smb-common.c4
-rw-r--r--epan/filesystem.c11
-rw-r--r--epan/wslua/wslua_proto.c16
-rw-r--r--ipmap.html4
-rw-r--r--mkcap.c11
-rw-r--r--plugins/mate/packet-mate.c8
-rw-r--r--tshark.c2
-rw-r--r--ui/cli/tap-rtp.c3
-rw-r--r--ui/gtk/airpcap_dlg.c10
-rw-r--r--ui/gtk/hostlist_table.c25
-rw-r--r--ui/gtk/main_menubar.c3
-rw-r--r--ui/gtk/main_welcome.c3
-rw-r--r--ui/gtk/proto_hier_stats_dlg.c4
-rw-r--r--wiretap/vwr.c9
15 files changed, 56 insertions, 71 deletions
diff --git a/epan/dissectors/packet-rdp.c b/epan/dissectors/packet-rdp.c
index f5a3d9b1bf..de5932aa26 100644
--- a/epan/dissectors/packet-rdp.c
+++ b/epan/dissectors/packet-rdp.c
@@ -20,7 +20,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
@@ -1413,17 +1413,7 @@ dissect_rdp_SendData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
{hf_rdp_pduSource, 2, NULL, 0, 0, NULL },
FI_TERMINATOR
};
-#ifdef RDPELE
- rdp_field_info_t license_fields[] = {
- {hf_rdp_serverRandom, 2, NULL, 0, 0, NULL },
- {hf_rdp_dwVersion, 4, NULL, 0, 0, NULL },
- {hf_rdp_cbCompanyName, 4, &cbCompanyName, 0, 0, NULL },
- {hf_rdp_pbCompanyName, 0, &cbCompanyName, 0, RDP_FI_UNICODE, NULL },
- {hf_rdp_cbProductId, 4, &cbProductId, 0, 0, NULL },
- {hf_rdp_pbProductId, 0, &cbProductId, 0, RDP_FI_UNICODE, NULL },
- FI_TERMINATOR
- };
-#endif
+
length = tvb_length_remaining(tvb, offset);
tree = dissect_rdp(tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-smb-common.c b/epan/dissectors/packet-smb-common.c
index 0f76486d6c..d1bd801db9 100644
--- a/epan/dissectors/packet-smb-common.c
+++ b/epan/dissectors/packet-smb-common.c
@@ -22,7 +22,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef HAVE_CONFIG_H
@@ -240,7 +240,7 @@ get_unicode_or_ascii_string(tvbuff_t *tvb, int *offsetp,
}
if (useunicode) {
- if ((!nopad) && (*offsetp % 2)) {
+ if ((!nopad) && (*bcp % 2)) {
(*offsetp)++; /* Looks like a pad byte there sometimes */
(*bcp)--;
diff --git a/epan/filesystem.c b/epan/filesystem.c
index ea41a10eda..f4019afc1f 100644
--- a/epan/filesystem.c
+++ b/epan/filesystem.c
@@ -19,7 +19,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef HAVE_CONFIG_H
@@ -1053,13 +1053,10 @@ get_persconffile_dir_no_profile(void)
*/
pwd = getpwuid(getuid());
if (pwd != NULL) {
- /*
- * This is cached, so we don't need to worry
- * about allocating multiple ones of them.
- */
- homedir = g_strdup(pwd->pw_dir);
- } else
+ homedir = pwd->pw_dir;
+ } else {
homedir = "/tmp";
+ }
}
persconffile_dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", homedir, PF_DIR);
#endif
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c
index 439a91c58d..0594208fbb 100644
--- a/epan/wslua/wslua_proto.c
+++ b/epan/wslua/wslua_proto.c
@@ -24,7 +24,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef HAVE_CONFIG_H
@@ -618,12 +618,18 @@ WSLUA_CONSTRUCTOR ProtoField_new(lua_State* L) { /* Creates a new field to be us
f->type = get_ftenum(luaL_checkstring(L,WSLUA_ARG_ProtoField_new_TYPE));
/*XXX do it better*/
- if (f->type == FT_NONE)
+ if (f->type == FT_NONE) {
+ g_free(f->name);
+ g_free(f->abbr);
+ g_free(f);
WSLUA_ARG_ERROR(ProtoField_new,TYPE,"invalid ftypes");
+ }
if (proto_check_field_name(f->abbr)) {
- WSLUA_ARG_ERROR(ProtoField_new,ABBR,"Invalid char in abbrev");
- return 0;
+ g_free(f->name);
+ g_free(f->abbr);
+ g_free(f);
+ WSLUA_ARG_ERROR(ProtoField_new,ABBR,"Invalid char in abbrev");
}
if (! lua_isnil(L,WSLUA_OPTARG_ProtoField_new_VOIDSTRING) ) {
@@ -639,6 +645,8 @@ WSLUA_CONSTRUCTOR ProtoField_new(lua_State* L) { /* Creates a new field to be us
} else if (tfs) {
f->vs = TFS(tfs);
} else {
+ g_free(f->name);
+ g_free(f->abbr);
g_free(f);
return 0;
}
diff --git a/ipmap.html b/ipmap.html
index 0ea1864236..c1686206ce 100644
--- a/ipmap.html
+++ b/ipmap.html
@@ -55,9 +55,9 @@
new OpenLayers.Control.ZoomBox(),
new OpenLayers.Control.ScaleLine(),
new OpenLayers.Control.MousePosition(),
- new OpenLayers.Control.MouseDefaults(),
+ new OpenLayers.Control.Navigation(),
new OpenLayers.Control.Attribution()
- ],
+ ]
//projection: new OpenLayers.Projection("EPSG:900913"),
//displayProjection: new OpenLayers.Projection("EPSG:4326"),
//maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34, 20037508.34, 20037508.34),
diff --git a/mkcap.c b/mkcap.c
index c246c65f84..5f9515971a 100644
--- a/mkcap.c
+++ b/mkcap.c
@@ -20,7 +20,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Using it to generate a capture file:
* ./mkcap [some-flags] > some-file
@@ -320,10 +320,9 @@ gen_next_ack(int force, int spacing)
void
makeackedrun(int len, int spacing, int ackdelay)
{
- int old_seq1, next_ack_ts=0;
+ int next_ack_ts=0;
if (verbose) fprintf(stderr, "makeackedrun: Len=%d, spacing=%d, ackdelay=%d\n",
len, spacing, ackdelay);
- old_seq1=seq_1;
while(len>0){
/*
@@ -456,7 +455,6 @@ makeackedrundroppedtail8kb(int len, int spacing, int ackdelay)
if(num_dupes<3){
int seglen;
- int new_seq;
ts+=1000000;
seglen=((seq_1-dropped_tail)>1460)?1460:(seq_1-dropped_tail);
if(seglen==1460){
@@ -466,7 +464,6 @@ makeackedrundroppedtail8kb(int len, int spacing, int ackdelay)
}
ts+=ackdelay;
- new_seq=seglen+seq_1;
makeseg(eth_2, eth_1, ip_2, ip_1, port_2, port_1, &seq_2, &seq_1, "10", 0);
ts+=spacing;
return;
@@ -528,7 +525,7 @@ all_digits(char *str)
void
process_drop_list(char *drop_list)
{
- int commas=0, i;
+ int commas=0;
char *tok, *save;
if (!drop_list || !(*drop_list)) {
@@ -574,8 +571,8 @@ process_drop_list(char *drop_list)
else
drops[commas / 2].drop_seg_start = num;
}
-
+ g_free(save);
}
diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c
index 5aa8a2a36f..37f4baed1c 100644
--- a/plugins/mate/packet-mate.c
+++ b/plugins/mate/packet-mate.c
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
@@ -119,12 +119,6 @@ static void mate_gog_tree(proto_tree* tree, tvbuff_t *tvb, mate_gog* gog, mate_g
proto_tree *gog_gop_tree;
mate_pdu* pdu;
-#ifdef _MATE_DEBUGGING
- proto_item* gog_key_item;
- proto_tree* gog_key_tree;
- guint i;
-#endif
-
gog_item = proto_tree_add_uint(tree,gog->cfg->hfid,tvb,0,0,gog->id);
gog_tree = proto_item_add_subtree(gog_item,gog->cfg->ett);
diff --git a/tshark.c b/tshark.c
index 2b83d54881..934c69408a 100644
--- a/tshark.c
+++ b/tshark.c
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef HAVE_CONFIG_H
diff --git a/ui/cli/tap-rtp.c b/ui/cli/tap-rtp.c
index d59ada43aa..20da2283bc 100644
--- a/ui/cli/tap-rtp.c
+++ b/ui/cli/tap-rtp.c
@@ -26,7 +26,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
@@ -122,6 +122,7 @@ rtp_streams_stat_draw(void *arg _U_)
list = g_list_next(list);
+ g_free(payload_type);
}
diff --git a/ui/gtk/airpcap_dlg.c b/ui/gtk/airpcap_dlg.c
index 73272c192d..30fa398043 100644
--- a/ui/gtk/airpcap_dlg.c
+++ b/ui/gtk/airpcap_dlg.c
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef HAVE_CONFIG_H
@@ -2404,7 +2404,6 @@ on_merge_bt_clicked (GtkWidget* button _U_, gpointer user_data)
guint n_wireshark_keys = 0;
guint n_driver_keys = 0;
guint n_curr_adapter_keys = 0;
- guint n_total_keys = 0;
guint i = 0;
GList* wireshark_keys=NULL;
@@ -2424,14 +2423,12 @@ on_merge_bt_clicked (GtkWidget* button _U_, gpointer user_data)
/* Retrieve Wireshark keys */
wireshark_keys = get_wireshark_keys();
n_wireshark_keys = g_list_length(wireshark_keys);
- n_total_keys += n_wireshark_keys;
merged_list = merge_key_list(wireshark_keys,NULL);
/* Retrieve AirPcap driver's keys */
driver_keys = get_airpcap_driver_keys();
n_driver_keys = g_list_length(driver_keys);
- n_total_keys += n_driver_keys;
merged_list = merge_key_list(merged_list,driver_keys);
@@ -2446,7 +2443,6 @@ on_merge_bt_clicked (GtkWidget* button _U_, gpointer user_data)
merged_list = merge_key_list(merged_list_tmp,current_adapter_keys);
free_key_list(merged_list_tmp);
- n_total_keys += n_curr_adapter_keys;
}
/* Set up this new list as default for Wireshark and Adapters... */
@@ -2525,7 +2521,6 @@ on_import_bt_clicked (GtkWidget* button _U_, gpointer user_data)
guint n_wireshark_keys = 0;
guint n_driver_keys = 0;
guint n_curr_adapter_keys = 0;
- guint n_total_keys = 0;
guint i = 0;
GList* wireshark_keys=NULL;
@@ -2544,12 +2539,10 @@ on_import_bt_clicked (GtkWidget* button _U_, gpointer user_data)
wireshark_keys = get_wireshark_keys();
n_wireshark_keys = g_list_length(wireshark_keys);
- n_total_keys += n_wireshark_keys;
/* Retrieve AirPcap driver's keys */
driver_keys = get_airpcap_driver_keys();
n_driver_keys = g_list_length(driver_keys);
- n_total_keys += n_driver_keys;
merged_list = merge_key_list(merged_list,driver_keys);
@@ -2564,7 +2557,6 @@ on_import_bt_clicked (GtkWidget* button _U_, gpointer user_data)
merged_list = merge_key_list(merged_list_tmp,current_adapter_keys);
free_key_list(merged_list_tmp);
- n_total_keys += n_curr_adapter_keys;
}
/* Set up this new list as default for Wireshark and Adapters... */
diff --git a/ui/gtk/hostlist_table.c b/ui/gtk/hostlist_table.c
index 4f67b52fad..957785c597 100644
--- a/ui/gtk/hostlist_table.c
+++ b/ui/gtk/hostlist_table.c
@@ -20,7 +20,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef HAVE_CONFIG_H
@@ -41,7 +41,7 @@
#include <epan/tap.h>
#include <epan/strutil.h>
#ifdef HAVE_GEOIP
-#include "GeoIP.h"
+#include <GeoIP.h>
#include <epan/geoip_db.h>
#include <epan/pint.h>
#include <epan/filesystem.h>
@@ -934,6 +934,14 @@ typedef struct {
hostlist_table *talkers;
} map_t;
+static char *map_endpoint_opener;
+
+static void
+map_init(void)
+{
+ map_endpoint_opener = "{\n";
+}
+
/* XXX output in C locale */
static gboolean
map_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter,
@@ -964,7 +972,7 @@ map_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter,
},
*/
- fputs("{\n", map->out_file);
+ fputs(map_endpoint_opener, map->out_file);
fputs(" 'type': 'Feature', 'geometry': { 'type': 'Point', 'coordinates': [", map->out_file);
/* Longitude */
@@ -1029,7 +1037,9 @@ map_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter,
/* XXX - we could add specific icons, e.g. depending on the amount of packets or bytes */
fputs("' }\n", map->out_file);
- fputs("},\n", map->out_file); /* XXX - Trim the comma from the last item */
+ fputs("}", map->out_file);
+ map_endpoint_opener = ",\n{\n";
+
map->hosts_written = TRUE;
return FALSE;
@@ -1141,6 +1151,7 @@ open_as_map_cb(GtkWindow *copy_bt, gpointer data _U_)
fputs(tpl_line, map.out_file);
/* MUST match ipmap.html */
if (strstr(tpl_line, "// Start endpoint list")) {
+ map_init();
gtk_tree_model_foreach(GTK_TREE_MODEL(store), map_handle, &map);
}
}
@@ -1646,7 +1657,7 @@ init_hostlist_notebook_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
nb = gtk_notebook_new();
- gtk_container_add(GTK_CONTAINER(vbox), nb);
+ gtk_box_pack_start(GTK_BOX(vbox), nb, TRUE, TRUE, 0);
g_object_set_data(G_OBJECT(nb), NB_PAGES_KEY, pages);
page = 0;
@@ -1672,7 +1683,7 @@ init_hostlist_notebook_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
resolv_cb = gtk_check_button_new_with_mnemonic("Name resolution");
- gtk_container_add(GTK_CONTAINER(hbox), resolv_cb);
+ gtk_box_pack_start(GTK_BOX(hbox), resolv_cb, TRUE, TRUE, 0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolv_cb), TRUE);
gtk_widget_set_tooltip_text(resolv_cb,
"Show results of name resolutions rather than the \"raw\" values. Please note: The corresponding name resolution must be enabled.");
@@ -1680,7 +1691,7 @@ init_hostlist_notebook_cb(GtkWidget *w _U_, gpointer d _U_)
g_signal_connect(resolv_cb, "toggled", G_CALLBACK(hostlist_resolve_toggle_dest), pages);
filter_cb = gtk_check_button_new_with_mnemonic("Limit to display filter");
- gtk_container_add(GTK_CONTAINER(hbox), filter_cb);
+ gtk_box_pack_start(GTK_BOX(hbox), filter_cb, TRUE, TRUE, 0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filter_cb), FALSE);
gtk_widget_set_tooltip_text(filter_cb, "Limit the list to endpoints matching the current display filter.");
diff --git a/ui/gtk/main_menubar.c b/ui/gtk/main_menubar.c
index 3da27b17d6..d9e10124cd 100644
--- a/ui/gtk/main_menubar.c
+++ b/ui/gtk/main_menubar.c
@@ -19,7 +19,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -4211,6 +4211,7 @@ add_menu_recent_capture_file_absolute(gchar *cf_name) {
submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
if(!submenu_recent_files){
g_warning("add_menu_recent_capture_file_absolute: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
+ g_free(normalized_cf_name);
return;
}
recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
diff --git a/ui/gtk/main_welcome.c b/ui/gtk/main_welcome.c
index 2f26b804cd..bd8ed7f572 100644
--- a/ui/gtk/main_welcome.c
+++ b/ui/gtk/main_welcome.c
@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef HAVE_CONFIG_H
@@ -1215,7 +1215,6 @@ welcome_new(void)
GtkWidget *file_child_box;
#ifdef _WIN32
DWORD chimney_enabled = 0;
- DWORD ce_size = sizeof(chimney_enabled);
#endif
/* prepare colors */
#if 0
diff --git a/ui/gtk/proto_hier_stats_dlg.c b/ui/gtk/proto_hier_stats_dlg.c
index 024b1342c6..b4b9016778 100644
--- a/ui/gtk/proto_hier_stats_dlg.c
+++ b/ui/gtk/proto_hier_stats_dlg.c
@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
@@ -453,7 +453,7 @@ create_tree(GtkWidget *container, ph_stats_t *ps)
sw = scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
GTK_SHADOW_IN);
- gtk_container_add(GTK_CONTAINER(container), sw);
+ gtk_box_pack_start(GTK_BOX(container), sw, TRUE, TRUE, 0);
store = gtk_tree_store_new(NUM_STAT_COLUMNS, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
diff --git a/wiretap/vwr.c b/wiretap/vwr.c
index 8726ee387a..6244910b38 100644
--- a/wiretap/vwr.c
+++ b/wiretap/vwr.c
@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifdef HAVE_CONFIG_H
@@ -808,12 +808,11 @@ static gboolean vwr_seek_read(wtap *wth, gint64 seek_off, union wtap_pseudo_head
static gboolean vwr_read_rec_header(vwr_t *vwr, FILE_T fh, int *rec_size, int *IS_TX, int *err, gchar **err_info)
{
- int bytes_read, file_off;
+ int bytes_read;
int f_len, v_type;
guint8 header[16];
errno = WTAP_ERR_CANT_READ;
- file_off = 0;
*rec_size = 0;
/* read out the file data in 16-byte messages, stopping either after we find a frame, */
@@ -826,8 +825,6 @@ static gboolean vwr_read_rec_header(vwr_t *vwr, FILE_T fh, int *rec_size, int *I
*err = file_error(fh, err_info);
return(FALSE);
}
- else
- file_off += bytes_read;
/* got a header; invoke decode-message function to parse and process it */
/* if the function returns a length, then a frame or variable-length message */
@@ -842,8 +839,6 @@ static gboolean vwr_read_rec_header(vwr_t *vwr, FILE_T fh, int *rec_size, int *I
else if (v_type != VT_FRAME) {
if (file_seek(fh, f_len, SEEK_CUR, err) < 0)
return(FALSE);
- else
- file_off += f_len;
}
else {
*rec_size = f_len;