diff options
Diffstat (limited to 'test/sanitizer_common/TestCases/Posix/fgetln.cc')
-rw-r--r-- | test/sanitizer_common/TestCases/Posix/fgetln.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/test/sanitizer_common/TestCases/Posix/fgetln.cc b/test/sanitizer_common/TestCases/Posix/fgetln.cc index e98cf449a272..b1b4665389a3 100644 --- a/test/sanitizer_common/TestCases/Posix/fgetln.cc +++ b/test/sanitizer_common/TestCases/Posix/fgetln.cc @@ -1,24 +1,20 @@ // RUN: %clangxx -O0 -g %s -o %t && %run %t // UNSUPPORTED: linux +#include <assert.h> #include <stdio.h> #include <stdlib.h> int main(void) { - FILE *fp; - size_t len; - char *s; - - fp = fopen("/etc/hosts", "r"); - if (!fp) - exit(1); + FILE *fp = fopen("/etc/hosts", "r"); + assert(fp); - s = fgetln(fp, &len); + size_t len; + char *s = fgetln(fp, &len); printf("%.*s\n", (int)len, s); - if (fclose(fp) == EOF) - exit(1); + assert(!fclose(fp)); return 0; } |