[HUST CSE]fix closing the same file twice

This commit is contained in:
Chef003 2023-04-21 16:39:46 +08:00 committed by Yunjie Gu
parent 3f442bbe4a
commit 06829534e1
1 changed files with 2 additions and 2 deletions

View File

@ -9,12 +9,12 @@ static int fclose_entry(void)
perror("fopen fail");
return -1;
}
if(fclose(stream))
if(fclose(stream) != 0)
{
perror("fclose fail");
return -1;
}
if(fclose(stream))
else
{
printf("fclose sucess \n");
}