diff options
-rw-r--r-- | tests/test_str_print_banner.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_str_print_banner.c b/tests/test_str_print_banner.c index 0ca09fd..3a5de8b 100644 --- a/tests/test_str_print_banner.c +++ b/tests/test_str_print_banner.c @@ -5,6 +5,12 @@ const char *testFmt = "case %zu: '%s' is length %zu, expected %zu\n"; const char *testFmtChars = "case %zu: '%s' got '%c' (pos: %zu), expected '%c'\n"; int main(int argc, char *argv[]) { + char *tty_path = NULL; + if ((tty_path = ttyname(STDOUT_FILENO)) == NULL) { + perror("tty check"); + return 0; + } + const int max_banner = 'z'; const int max_banner_len = 80; char buf[BUFSIZ] = {0,}; @@ -40,4 +46,4 @@ int main(int argc, char *argv[]) { dup2(stdout_save, STDOUT_FILENO); setvbuf(stdout, NULL, _IONBF, 0); } -}
\ No newline at end of file +} |