Browse Source

check more return values

Mike Frysinger 18 năm trước cách đây
mục cha
commit
60fa5490bc
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      test/misc/fdopen.c

+ 3 - 3
test/misc/fdopen.c

@@ -29,8 +29,8 @@ main (int argc, char *argv[])
 
   fp = fopen (name, "w");
   assert (fp != NULL)
-  fputs ("foobar and baz", fp);
-  fclose (fp);
+  assert (fputs ("foobar and baz", fp) > 0);
+  assert (fclose (fp) == 0);
   fp = NULL;
 
   fd = open (name, O_RDWR|O_CREAT);
@@ -45,7 +45,7 @@ main (int argc, char *argv[])
 
 the_end:
   if (fp != NULL)
-    fclose (fp);
+    assert (fclose (fp) == 0);
   unlink (name);
 
   return retval;