summaryrefslogtreecommitdiff
path: root/wiretap/csids.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-04-06 06:51:19 +0000
committerGuy Harris <guy@alum.mit.edu>2011-04-06 06:51:19 +0000
commit4c93827e34e879111b00873b2cd7c823b6b69f88 (patch)
treefdb9ea83c685200de45a790065fcc6be6a26fc88 /wiretap/csids.c
parentc039f9f8a8bb04d2a8dcd6e2ec1facaee3f1f855 (diff)
downloadwireshark-4c93827e34e879111b00873b2cd7c823b6b69f88.tar.gz
From Jakub Zawadzki:
file_read(buf, bsize, count, file) macro is compilant with fread function and takes elements count+ size of each element, however to make it compilant with gzread() it always returns number of bytes. In wiretap file_read() this is not really used, file_read is called either with bsize set to 1 or count to 1. Attached patch remove bsize argument from macro. svn path=/trunk/; revision=36491
Diffstat (limited to 'wiretap/csids.c')
-rw-r--r--wiretap/csids.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/wiretap/csids.c b/wiretap/csids.c
index c70c212466..542062ea15 100644
--- a/wiretap/csids.c
+++ b/wiretap/csids.c
@@ -78,7 +78,7 @@ int csids_open(wtap *wth, int *err, gchar **err_info _U_)
csids_t *csids;
/* check the file to make sure it is a csids file. */
- bytesRead = file_read( &hdr, 1, sizeof( struct csids_header), wth->fh );
+ bytesRead = file_read( &hdr, sizeof( struct csids_header), wth->fh );
if( bytesRead != sizeof( struct csids_header) ) {
*err = file_error( wth->fh );
if( *err != 0 ) {
@@ -92,7 +92,7 @@ int csids_open(wtap *wth, int *err, gchar **err_info _U_)
}
hdr.seconds = pntohl( &hdr.seconds );
hdr.caplen = pntohs( &hdr.caplen );
- bytesRead = file_read( &tmp, 1, 2, wth->fh );
+ bytesRead = file_read( &tmp, 2, wth->fh );
if( bytesRead != 2 ) {
*err = file_error( wth->fh );
if( *err != 0 ) {
@@ -101,7 +101,7 @@ int csids_open(wtap *wth, int *err, gchar **err_info _U_)
return 0;
}
}
- bytesRead = file_read( &iplen, 1, 2, wth->fh );
+ bytesRead = file_read( &iplen, 2, wth->fh );
if( bytesRead != 2 ) {
*err = file_error( wth->fh );
if( *err != 0 ) {
@@ -161,7 +161,7 @@ static gboolean csids_read(wtap *wth, int *err, gchar **err_info _U_,
*data_offset = wth->data_offset;
- bytesRead = file_read( &hdr, 1, sizeof( struct csids_header) , wth->fh );
+ bytesRead = file_read( &hdr, sizeof( struct csids_header) , wth->fh );
if( bytesRead != sizeof( struct csids_header) ) {
*err = file_error( wth->fh );
if (*err == 0 && bytesRead != 0)
@@ -177,7 +177,7 @@ static gboolean csids_read(wtap *wth, int *err, gchar **err_info _U_,
buffer_assure_space(wth->frame_buffer, hdr.caplen);
buf = buffer_start_ptr(wth->frame_buffer);
- bytesRead = file_read( buf, 1, hdr.caplen, wth->fh );
+ bytesRead = file_read( buf, hdr.caplen, wth->fh );
if( bytesRead != hdr.caplen ) {
*err = file_error( wth->fh );
if (*err == 0)
@@ -218,7 +218,7 @@ csids_seek_read (wtap *wth,
if( file_seek( wth->random_fh, seek_off, SEEK_SET, err ) == -1 )
return FALSE;
- bytesRead = file_read( &hdr, 1, sizeof( struct csids_header), wth->random_fh );
+ bytesRead = file_read( &hdr, sizeof( struct csids_header), wth->random_fh );
if( bytesRead != sizeof( struct csids_header) ) {
*err = file_error( wth->random_fh );
if( *err == 0 ) {
@@ -236,7 +236,7 @@ csids_seek_read (wtap *wth,
return FALSE;
}
- bytesRead = file_read( pd, 1, hdr.caplen, wth->random_fh );
+ bytesRead = file_read( pd, hdr.caplen, wth->random_fh );
if( bytesRead != hdr.caplen ) {
*err = file_error( wth->random_fh );
if( *err == 0 ) {