Second attempt to squash ingnored return errors on fread()

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6594 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2016-04-06 23:18:29 +00:00
parent a0ab926a26
commit 365fc32f31

View File

@ -79,15 +79,15 @@ void getfile(QString fname, int ntrperiod)
} fmt; } fmt;
// read header // read header
(void)fread(&desc, 1, sizeof desc, fp); // RIFF if (fread(&desc, sizeof desc, 1, fp) < 1) return; // RIFF
(void)fread(type, 1, sizeof type, fp); // WAVE if (fread(type, sizeof type, 1, fp) < 1) return; // WAVE
do do
{ {
(void)fread(&desc, 1, sizeof desc, fp); // WAVE component if (fread(&desc, sizeof desc, 1, fp) < 1) return; // WAVE component
if (!memcmp(desc.id,"fmt ",4)) { if (!memcmp(desc.id,"fmt ",4)) {
fpos_t pos; fpos_t pos;
fgetpos(fp,&pos); fgetpos(fp,&pos);
(void)fread(&fmt,1,sizeof fmt,fp); if (fread(&fmt,sizeof fmt,1,fp) < 1) return;
fsetpos(fp,&pos); fsetpos(fp,&pos);
} }
if (!memcmp(desc.id,"data",sizeof desc.id)) break; if (!memcmp(desc.id,"data",sizeof desc.id)) break;