소스 검색

[HUST CSE]fix closing the same file twice

Chef003 2 년 전
부모
커밋
06829534e1
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      examples/utest/testcases/posix/stdio_h/functions/fclose_tc.c

+ 2 - 2
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");
     }