File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -202,20 +202,16 @@ void CheckIO::checkFileUsage()
202202 operation = Filepointer::OPEN;
203203 } else if ((tok->str () == " rewind" || tok->str () == " fseek" || tok->str () == " fsetpos" || tok->str () == " fflush" ) ||
204204 (windows && tok->str () == " _fseeki64" )) {
205- if (printPortability && tok->str () == " fflush" ) {
206- fileTok = tok->tokAt (2 );
207- if (fileTok) {
208- if (fileTok->str () == " stdin" )
205+ fileTok = tok->tokAt (2 );
206+ if (printPortability && fileTok && tok->str () == " fflush" ) {
207+ if (fileTok->str () == " stdin" )
208+ fflushOnInputStreamError (tok, fileTok->str ());
209+ else {
210+ Filepointer& f = filepointers[fileTok->varId ()];
211+ if (f.mode == READ_MODE)
209212 fflushOnInputStreamError (tok, fileTok->str ());
210- else {
211- Filepointer& f = filepointers[fileTok->varId ()];
212- if (f.mode == READ_MODE)
213- fflushOnInputStreamError (tok, fileTok->str ());
214- }
215213 }
216214 }
217-
218- fileTok = tok->tokAt (2 );
219215 operation = Filepointer::POSITIONING;
220216 } else if (tok->str () == " fgetc" || tok->str () == " fgetwc" ||
221217 tok->str () == " fgets" || tok->str () == " fgetws" || tok->str () == " fread" ||
You can’t perform that action at this time.
0 commit comments