From 041857e677d1282b5ccfdc8d79500a902352877a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Mon, 11 Jan 2021 16:19:50 +0000 Subject: [PATCH] tests: ensure compiler knows the argv[0] is non-NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../tests/redirect-test.c /usr/i686-w64-mingw32/sys-root/mingw/include/winbase.h: In function 'WinMain': ../../tests/redirect-test.c:318:5: error: '%s' directive argument is null [-Werror=format-overflow=] 318 | fprintf(log_f, "argc %d argv[0] %s \n", argc, argv[0]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../tests/redirect-test.c:318:5: error: '%s' directive argument is null [-Werror=format-overflow=] Signed-off-by: Daniel P. Berrangé --- tests/redirect-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/redirect-test.c b/tests/redirect-test.c index be96cd0..27b381b 100644 --- a/tests/redirect-test.c +++ b/tests/redirect-test.c @@ -315,6 +315,7 @@ int WINAPI WinMain(HINSTANCE hInstance G_GNUC_UNUSED, HINSTANCE hPrevInstance G_ assert(log_f); setbuf(log_f, NULL); + assert(argv[0]); fprintf(log_f, "argc %d argv[0] %s \n", argc, argv[0]); if (argc >= 1) {