tests: ensure compiler knows the argv[0] is non-NULL

../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é <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2021-01-11 16:19:50 +00:00
parent 7f9aba52c7
commit 041857e677

View File

@ -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) {