Skip to content

Commit 0682953

Browse files
mojito03CuttySark1869
authored andcommitted
[HUST CSE]fix closing the same file twice
1 parent 3f442bb commit 0682953

File tree

1 file changed

+2
-2
lines changed
  • examples/utest/testcases/posix/stdio_h/functions

1 file changed

+2
-2
lines changed

Diff for: examples/utest/testcases/posix/stdio_h/functions/fclose_tc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ static int fclose_entry(void)
99
perror("fopen fail");
1010
return -1;
1111
}
12-
if(fclose(stream))
12+
if(fclose(stream) != 0)
1313
{
1414
perror("fclose fail");
1515
return -1;
1616
}
17-
if(fclose(stream))
17+
else
1818
{
1919
printf("fclose sucess \n");
2020
}

0 commit comments

Comments
 (0)