]> jfr.im git - irc/charybdis-ircd/charybdis.git/commitdiff
wsockd: avoid clang static analysis warning
authorSimon Arlott <sa.me.uk>
Sat, 29 Jul 2017 20:05:41 +0000 (21:05 +0100)
committerSimon Arlott <sa.me.uk>
Sat, 29 Jul 2017 21:39:53 +0000 (22:39 +0100)
Don't set `x = 0` twice.

wsockd/wsockd.c

index 29bbdffbd33c862be5b54501c2fef870cb1105e2..2f1310045708cca601db74431ad5f1ed5b170136 100644 (file)
@@ -951,7 +951,7 @@ int
 main(int argc, char **argv)
 {
        const char *s_ctlfd, *s_pipe, *s_pid;
-       int ctlfd, pipefd, x, maxfd;
+       int ctlfd, pipefd, maxfd;
        maxfd = maxconn();
 
        s_ctlfd = getenv("CTL_FD");
@@ -970,8 +970,9 @@ main(int argc, char **argv)
        ctlfd = atoi(s_ctlfd);
        pipefd = atoi(s_pipe);
        ppid = atoi(s_pid);
-       x = 0;
+
 #ifndef _WIN32
+       int x = 0;
        for(x = 0; x < maxfd; x++)
        {
                if(x != ctlfd && x != pipefd && x > 2)