From 4c4c74f7d550546d0d7aab1150cdbc0296568b50 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 28 Sep 2023 10:27:33 +0200 Subject: [PATCH] test/hexdump: hide output (#968) --- test/fmt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/fmt.c b/test/fmt.c index 6d2528de1..79a93aecc 100644 --- a/test/fmt.c +++ b/test/fmt.c @@ -1132,7 +1132,17 @@ int test_fmt_hexdump(void) "8abcjt5m950gxvkuvippcvt60me9z5zh" ; - hexdump(stdout, buf, str_len(buf)); +#ifdef WIN32 + FILE *f = fopen("nul", "w"); +#else + FILE *f = fopen("/dev/null", "w"); +#endif + if (!f) + return EINVAL; + + hexdump(f, buf, str_len(buf)); + + fclose(f); return 0; }