From dd6f48ccca6fbad5af0ae8af726265a3f6bb0921 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 6 Apr 2016 23:18:29 +0000 Subject: [PATCH] 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 --- getfile.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/getfile.cpp b/getfile.cpp index eed33b044..ed227dd38 100644 --- a/getfile.cpp +++ b/getfile.cpp @@ -79,15 +79,15 @@ void getfile(QString fname, int ntrperiod) } fmt; // read header - (void)fread(&desc, 1, sizeof desc, fp); // RIFF - (void)fread(type, 1, sizeof type, fp); // WAVE + if (fread(&desc, sizeof desc, 1, fp) < 1) return; // RIFF + if (fread(type, sizeof type, 1, fp) < 1) return; // WAVE 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)) { fpos_t pos; fgetpos(fp,&pos); - (void)fread(&fmt,1,sizeof fmt,fp); + if (fread(&fmt,sizeof fmt,1,fp) < 1) return; fsetpos(fp,&pos); } if (!memcmp(desc.id,"data",sizeof desc.id)) break;