From 06829534e1eb15c906ee4550b21c955302f6585a Mon Sep 17 00:00:00 2001 From: Chef003 Date: Fri, 21 Apr 2023 16:39:46 +0800 Subject: [PATCH] [HUST CSE]fix closing the same file twice --- examples/utest/testcases/posix/stdio_h/functions/fclose_tc.c | 4 ++-- 1 file 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"); }