summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorChef003 <[email protected]>2023-04-21 16:39:46 +0800
committerYunjie Gu <[email protected]>2023-04-21 23:03:34 +0100
commit06829534e1eb15c906ee4550b21c955302f6585a (patch)
treeaadd76cc44de1cbe98634520b589bcf7e3152f94 /examples
parent3f442bbe4afdbbc6669ed8fc27078a495e2233d8 (diff)
[HUST CSE]fix closing the same file twice
Diffstat (limited to 'examples')
-rw-r--r--examples/utest/testcases/posix/stdio_h/functions/fclose_tc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/utest/testcases/posix/stdio_h/functions/fclose_tc.c b/examples/utest/testcases/posix/stdio_h/functions/fclose_tc.c
index 03ed953914..c182283bbd 100644
--- a/examples/utest/testcases/posix/stdio_h/functions/fclose_tc.c
+++ b/examples/utest/testcases/posix/stdio_h/functions/fclose_tc.c
@@ -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");
}