]> arthur.barton.de Git - ngircd-alex.git/commitdiff
fix clang warning about dead stores
authorFlorian Westphal <fw@strlen.de>
Fri, 6 May 2011 18:31:56 +0000 (20:31 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 6 May 2011 18:31:56 +0000 (20:31 +0200)
clang 'scan-build':
Value stored to 'r' is never read
Value stored to 'fd' is never read

src/ngircd/irc-channel.c
src/ngircd/ngircd.c

index 476c313835f337b01bb0688c9a9a1e8d97135a83..66b3eeb24ed9677d4950709ac5fc06afe6c42b50 100644 (file)
@@ -526,6 +526,8 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req )
                                               Client_ID(Client),
                                               Channel_Name(chan), topic);
 #ifndef STRICT_RFC
+                       if (!r)
+                               return r;
                        r = IRC_WriteStrClient(from, RPL_TOPICSETBY_MSG,
                                               Client_ID(Client),
                                               Channel_Name(chan),
index 4cac909d8f02e3f4d60593693ee6855b49e7f338..58383cfaac51924b6782be3d7a08bf7a96a1056e 100644 (file)
@@ -706,10 +706,8 @@ NGIRCd_Init( bool NGIRCd_NoDaemon )
 
                /* Detach stdin, stdout and stderr */
                Setup_FDStreams(fd);
-               if (fd > 2) {
+               if (fd > 2)
                        close(fd);
-                       fd = -1;
-               }
        }
        pid = getpid();