Ethereal-dev: Re: [ethereal-dev] Checked in Wiretap changes to eliminate "ftell()" calls

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Mon, 30 Aug 1999 12:37:21 -0700 (PDT)
> Index: wiretap/radcom.c
> ===================================================================
> RCS file: /cvsroot/ethereal/wiretap/radcom.c,v
> retrieving revision 1.5
> diff -u -r1.5 radcom.c
> --- radcom.c	1999/08/28 01:19:45	1.5
> +++ radcom.c	1999/08/30 18:43:49
> @@ -167,12 +167,12 @@
>  
>  	if (wth->file_encap == WTAP_ENCAP_ETHERNET) {
>  		fseek(wth->fh, 294, SEEK_CUR);
> -		wth->data_offset = 294;
>  	} else if (wth->file_encap == WTAP_ENCAP_LAPB) {
>  		fseek(wth->fh, 297, SEEK_CUR);
> -		wth->data_offset = 297;
>  	}
>  
> +	wth->data_offset = ftell(wth->fh);
> +
>  	return 1;

Does changing that code to

	if (wth->file_encap == WTAP_ENCAP_ETHERNET) {
		fseek(wth->fh, 294, SEEK_CUR);
		wth->data_offset += 294;
	} else if (wth->file_encap == WTAP_ENCAP_LAPB) {
		fseek(wth->fh, 297, SEEK_CUR);
		wth->data_offset += 297;
	}

also work?