Răsfoiți Sursa

[HUST CSE]fix closing the same file twice

Chef003 2 ani în urmă
părinte
comite
06829534e1

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