diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-06 06:51:19 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-06 06:51:19 +0000 |
commit | 12d81f29ab60039523e22a89d466828ef3667f44 (patch) | |
tree | fdb9ea83c685200de45a790065fcc6be6a26fc88 /wiretap/btsnoop.c | |
parent | dc3009079956ca7abd0f84fd00e9dbcc6dd43000 (diff) |
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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36491 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/btsnoop.c')
-rw-r--r-- | wiretap/btsnoop.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/btsnoop.c b/wiretap/btsnoop.c index 8e9b91ea33..fd266f16b4 100644 --- a/wiretap/btsnoop.c +++ b/wiretap/btsnoop.c @@ -90,7 +90,7 @@ int btsnoop_open(wtap *wth, int *err, gchar **err_info _U_) /* Read in the string that should be at the start of a "btsnoop" file */ errno = WTAP_ERR_CANT_READ; - bytes_read = file_read(magic, 1, sizeof magic, wth->fh); + bytes_read = file_read(magic, sizeof magic, wth->fh); if (bytes_read != sizeof magic) { *err = file_error(wth->fh); if (*err != 0) @@ -105,7 +105,7 @@ int btsnoop_open(wtap *wth, int *err, gchar **err_info _U_) /* Read the rest of the header. */ errno = WTAP_ERR_CANT_READ; - bytes_read = file_read(&hdr, 1, sizeof hdr, wth->fh); + bytes_read = file_read(&hdr, sizeof hdr, wth->fh); if (bytes_read != sizeof hdr) { *err = file_error(wth->fh); if (*err != 0) @@ -172,7 +172,7 @@ static gboolean btsnoop_read(wtap *wth, int *err, gchar **err_info, /* Read record header. */ errno = WTAP_ERR_CANT_READ; - bytes_read = file_read(&hdr, 1, sizeof hdr, wth->fh); + bytes_read = file_read(&hdr, sizeof hdr, wth->fh); if (bytes_read != sizeof hdr) { *err = file_error(wth->fh); if (*err == 0 && bytes_read != 0) @@ -246,7 +246,7 @@ static gboolean btsnoop_seek_read(wtap *wth, gint64 seek_off, /* Read record header. */ errno = WTAP_ERR_CANT_READ; - bytes_read = file_read(&hdr, 1, sizeof hdr, wth->random_fh); + bytes_read = file_read(&hdr, sizeof hdr, wth->random_fh); if (bytes_read != sizeof hdr) { *err = file_error(wth->random_fh); if (*err == 0 && bytes_read != 0) @@ -293,7 +293,7 @@ snoop_read_rec_data(FILE_T fh, guchar *pd, int length, int *err) int bytes_read; errno = WTAP_ERR_CANT_READ; - bytes_read = file_read(pd, 1, length, fh); + bytes_read = file_read(pd, length, fh); if (bytes_read != length) { *err = file_error(fh); |