aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/mpeg.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/mpeg.c
parentc039f9f8a8bb04d2a8dcd6e2ec1facaee3f1f855 (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. svn path=/trunk/; revision=36491
Diffstat (limited to 'wiretap/mpeg.c')
-rw-r--r--wiretap/mpeg.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/wiretap/mpeg.c b/wiretap/mpeg.c
index 8ac25590c3..881a9b1a29 100644
--- a/wiretap/mpeg.c
+++ b/wiretap/mpeg.c
@@ -81,7 +81,7 @@ mpeg_read_header(wtap *wth, int *err, gchar **err_info _U_,
int bytes_read;
errno = WTAP_ERR_CANT_READ;
- bytes_read = file_read(n, 1, sizeof *n, wth->fh);
+ bytes_read = file_read(n, sizeof *n, wth->fh);
if (bytes_read != sizeof *n) {
*err = file_error(wth->fh);
if (*err == 0 && bytes_read != 0)
@@ -100,7 +100,7 @@ mpeg_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);
@@ -134,7 +134,7 @@ mpeg_read(wtap *wth, int *err, gchar **err_info _U_,
if (file_seek(wth->fh, 3, SEEK_CUR, err) == -1)
return FALSE;
- bytes_read = file_read(&stream, 1, sizeof stream, wth->fh);
+ bytes_read = file_read(&stream, sizeof stream, wth->fh);
if (bytes_read != sizeof stream) {
*err = file_error(wth->fh);
return FALSE;
@@ -146,14 +146,14 @@ mpeg_read(wtap *wth, int *err, gchar **err_info _U_,
guint64 pack;
guint8 stuffing;
- bytes_read = file_read(&pack1, 1, sizeof pack1, wth->fh);
+ bytes_read = file_read(&pack1, sizeof pack1, wth->fh);
if (bytes_read != sizeof pack1) {
*err = file_error(wth->fh);
if (*err == 0 && bytes_read != 0)
*err = WTAP_ERR_SHORT_READ;
return FALSE;
}
- bytes_read = file_read(&pack0, 1, sizeof pack0, wth->fh);
+ bytes_read = file_read(&pack0, sizeof pack0, wth->fh);
if (bytes_read != sizeof pack0) {
*err = file_error(wth->fh);
if (*err == 0 && bytes_read != 0)
@@ -167,7 +167,7 @@ mpeg_read(wtap *wth, int *err, gchar **err_info _U_,
if (file_seek(wth->fh, 1, SEEK_CUR, err) == -1)
return FALSE;
bytes_read = file_read(&stuffing,
- 1, sizeof stuffing, wth->fh);
+ sizeof stuffing, wth->fh);
if (bytes_read != sizeof stuffing) {
*err = file_error(wth->fh);
return FALSE;
@@ -196,7 +196,7 @@ mpeg_read(wtap *wth, int *err, gchar **err_info _U_,
}
} else {
guint16 length;
- bytes_read = file_read(&length, 1, sizeof length, wth->fh);
+ bytes_read = file_read(&length, sizeof length, wth->fh);
if (bytes_read != sizeof length) {
*err = file_error(wth->fh);
if (*err == 0 && bytes_read != 0)
@@ -269,7 +269,7 @@ mpeg_open(wtap *wth, int *err, gchar **err_info _U_)
mpeg_t *mpeg;
errno = WTAP_ERR_CANT_READ;
- bytes_read = file_read(magic_buf, 1, sizeof magic_buf, wth->fh);
+ bytes_read = file_read(magic_buf, sizeof magic_buf, wth->fh);
if (bytes_read != (int) sizeof magic_buf) {
*err = file_error(wth->fh);
if (*err != 0)