From: Florian Westphal Date: Fri, 6 May 2011 18:31:56 +0000 (+0200) Subject: fix clang warning about dead stores X-Git-Tag: rel-18-rc1~13 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=commitdiff_plain;h=605b6a67bc7f41432d25ab646c232e347fd7a33f fix clang warning about dead stores clang 'scan-build': Value stored to 'r' is never read Value stored to 'fd' is never read --- diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c index 476c3138..66b3eeb2 100644 --- a/src/ngircd/irc-channel.c +++ b/src/ngircd/irc-channel.c @@ -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), diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c index 4cac909d..58383cfa 100644 --- a/src/ngircd/ngircd.c +++ b/src/ngircd/ngircd.c @@ -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();