diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-04-06 06:51:19 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-04-06 06:51:19 +0000 |
commit | 4c93827e34e879111b00873b2cd7c823b6b69f88 (patch) | |
tree | fdb9ea83c685200de45a790065fcc6be6a26fc88 /wiretap/file_wrappers.h | |
parent | c039f9f8a8bb04d2a8dcd6e2ec1facaee3f1f855 (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/file_wrappers.h')
-rw-r--r-- | wiretap/file_wrappers.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/wiretap/file_wrappers.h b/wiretap/file_wrappers.h index a51d722056..93dec01434 100644 --- a/wiretap/file_wrappers.h +++ b/wiretap/file_wrappers.h @@ -32,8 +32,7 @@ extern int file_error(void *fh); extern FILE_T file_open(const char *path, const char *mode); #define filed_open gzdopen -/* XX: gzread and gzwrite return number of *bytes* (not number of elements) */ -#define file_read(buf, bsize, count, file) gzread((file),(buf),(unsigned)((count)*(bsize))) +#define file_read(buf, count, file) gzread((file),(buf),(unsigned)(count)) #define file_close gzclose #define file_getc gzgetc #define file_gets(buf, len, file) gzgets((file), (buf), (len)) @@ -43,8 +42,7 @@ extern FILE_T file_open(const char *path, const char *mode); #define file_open(path, mode) ws_fopen(path, mode) #define filed_open fdopen -/* XX: file_read defined to return number of *bytes* to be consistent with gzread */ -#define file_read(buf, bsize, count, file) ((bsize) * fread((buf), (bsize), (count), (file))) +#define file_read(buf, count, file) fread((buf), (1), (count), (file)) #define file_close fclose #define file_getc fgetc #define file_gets fgets |