Skip to content

Commit 83d996f

Browse files
author
Daniel Kroening
authored
Merge pull request #377 from tautschnig/fflush-fix
C library: fflush(NULL) is permitted
2 parents 8e473cb + 4e999db commit 83d996f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ansi-c/library/stdio.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,12 @@ inline int fflush(FILE *stream)
313313
// just return nondet
314314
__CPROVER_HIDE:;
315315
int return_value;
316-
(void)*stream;
316+
(void)stream;
317317

318318
#ifdef __CPROVER_CUSTOM_BITVECTOR_ANALYSIS
319-
__CPROVER_assert(__CPROVER_get_must(stream, "open"),
320-
"fflush file must be open");
319+
if(stream)
320+
__CPROVER_assert(__CPROVER_get_must(stream, "open"),
321+
"fflush file must be open");
321322
#endif
322323

323324
return return_value;

0 commit comments

Comments
 (0)