From f8e02042cf5392278c41e4714fc051175da8f7fd Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 8 Jun 2021 11:57:04 +0200 Subject: tests/mock_guest.c: Use same integer type (long unsigned int) for comparing string length returned by snprintf() and a sizeof() return value. This resolves: mock_guest.c: In function 'socket_sucker': mock_guest.c:95:16: error: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Werror=sign-compare] 95 | if (printsize > sizeof(serv_addr.sun_path) - 1 || printsize < 0) { | ^ --- tests/mock_guest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/mock_guest.c b/tests/mock_guest.c index 6353ee1..6bdfc6f 100644 --- a/tests/mock_guest.c +++ b/tests/mock_guest.c @@ -92,7 +92,7 @@ socket_sucker () serv_addr.sun_family = AF_UNIX; - int printsize = snprintf(serv_addr.sun_path, sizeof(serv_addr.sun_path) - 1, "%s/%s", home, ".x2go-socket"); + long unsigned int printsize = (long unsigned int)snprintf(serv_addr.sun_path, sizeof(serv_addr.sun_path) - 1, "%s/%s", home, ".x2go-socket"); if (printsize > sizeof(serv_addr.sun_path) - 1 || printsize < 0) { return -1; } -- cgit v1.2.3