diff --git a/src/connection_unix.cpp b/src/connection_unix.cpp index bcab20c..518ea94 100644 --- a/src/connection_unix.cpp +++ b/src/connection_unix.cpp @@ -62,8 +62,9 @@ bool BaseConnection::Open(int pipe) int optval = 1; setsockopt(self->sock, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval)); #endif - for (pipe; pipe < 10; ++pipe) { - snprintf(PipeAddr.sun_path, sizeof(PipeAddr.sun_path), "%s/discord-ipc-%d", tempPath, pipe); + for (int pipeNum = pipe; pipeNum < 10; ++pipeNum) { + snprintf( + PipeAddr.sun_path, sizeof(PipeAddr.sun_path), "%s/discord-ipc-%d", tempPath, pipeNum); int err = connect(self->sock, (const sockaddr*)&PipeAddr, sizeof(PipeAddr)); if (err == 0) { self->isOpen = true;