From 3d3ae7129d17643bc706da0a2eea85aafd10ab3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 30 Jul 2018 21:50:49 +0200 Subject: [PATCH] Fix mismatched signs in comparison after b44defe (#209) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` ../src/discord_register_linux.cpp: In function ‘void Discord_Register(const char*, const char*)’: ../src/discord_register_linux.cpp:37:31: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare] if (size <= 0 || size >= sizeof(exePath)) { ~~~~~^~~~~~~~~~~~~~~~~~ ``` --- src/discord_register_linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/discord_register_linux.cpp b/src/discord_register_linux.cpp index 34f8701..09911dc 100644 --- a/src/discord_register_linux.cpp +++ b/src/discord_register_linux.cpp @@ -34,7 +34,7 @@ extern "C" DISCORD_EXPORT void Discord_Register(const char* applicationId, const char exePath[1024]; if (!command || !command[0]) { ssize_t size = readlink("/proc/self/exe", exePath, sizeof(exePath)); - if (size <= 0 || size >= sizeof(exePath)) { + if (size <= 0 || size >= (ssize_t)sizeof(exePath)) { return; } exePath[size] = '\0';