I see why now:
fread and fwrite return the number of items successfully
read or written (i.e., not the number of characters). If
an error occurs, or the end-of-file is reached, the return
value is a short item count (or zero).
In wiretap we fread an item size of 1 byte, with "nmemb" (the number of
members)
set to the number of bytes.
--gilbert
"Gilbert Ramirez Jr." <gram@xxxxxxxxxxxx> on 08/31/2000 11:44:56 AM
To: ethereal-cvs@xxxxxxxxxxxx
cc: (bcc: Gilbert Ramirez/Tivoli Systems)
Subject: [ethereal-cvs] cvs commit: ethereal/wiretap csids.c
gram 2000/08/31 11:44:52 CDT
Modified files:
wiretap csids.c
Log:
Re-arrange size and nmemb arguments in fread() (file_read()) calls so
that these calls work on Win32. I still don't have a good reason as to
why this is necessary, but it fixes the problem. I'll continue looking
for a reason.
Revision Changes Path
1.3 +8 -8 ethereal/wiretap/csids.c