From 95474a1687017de0adb2c6ce57c1ab7c0704c5c6 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 6 Jan 2020 12:26:15 +0100 Subject: [PATCH] c++: fix -Wformat --- clients/memcapable.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/memcapable.cc b/clients/memcapable.cc index 3e9bfabf..af120d0b 100644 --- a/clients/memcapable.cc +++ b/clients/memcapable.cc @@ -2159,7 +2159,7 @@ int main(int argc, char **argv) if (sock == INVALID_SOCKET) { fprintf(stderr, "Failed to connect to <%s:%s>: %s\n", - hostname, port, strerror(get_socket_errno())); + hostname?:"(null)", port?:"(null)", strerror(get_socket_errno())); return EXIT_FAILURE; } @@ -2231,7 +2231,7 @@ int main(int argc, char **argv) closesocket(sock); if ((sock= connect_server(hostname, port)) == INVALID_SOCKET) { - fprintf(stderr, "Failed to connect to <%s:%s>: %s\n", hostname, port, strerror(get_socket_errno())); + fprintf(stderr, "Failed to connect to <%s:%s>: %s\n", hostname?:"(null)", port?:"(null)", strerror(get_socket_errno())); fprintf(stderr, "%d of %d tests failed\n", failed, total); return EXIT_FAILURE; } -- 2.30.2