From: Michael Wallner Date: Mon, 6 Jan 2020 11:26:15 +0000 (+0100) Subject: c++: fix -Wformat X-Git-Tag: pre_cmake~88 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=95474a1687017de0adb2c6ce57c1ab7c0704c5c6;p=m6w6%2Flibmemcached c++: fix -Wformat --- 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; }