]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Fix compiler warning in Option_String()
authorAlexander Barton <alex@barton.de>
Mon, 29 Jan 2018 22:32:06 +0000 (23:32 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 29 Jan 2018 22:32:06 +0000 (23:32 +0100)
When compiling ngIRCd without support for SSL and without support for
ZLIB, gcc outputs the following warning:

  irc.c:493:9: warning: variable ‘options’ set but not used
    [-Wunused-but-set-variable]

Fix it by providing a dummy function in this case.

src/ngircd/irc.c

index 7acd84ee7857fa0a9a3b5e7af54b9384c9547f0f..dc3b2f2ecf120a4147074cae869f5406d6c9fb98 100644 (file)
@@ -483,11 +483,8 @@ Help(CLIENT *Client, const char *Topic)
  * @return Pointer to static (global) string buffer.
  */
 static char *
-#ifdef ZLIB
+#if defined(SSL_SUPPORT) || defined(ZLIB)
 Option_String(CONN_ID Idx)
-#else
-Option_String(UNUSED CONN_ID Idx)
-#endif
 {
        static char option_txt[8];
        UINT16 options;
@@ -507,6 +504,11 @@ Option_String(UNUSED CONN_ID Idx)
 #endif
 
        return option_txt;
+#else
+Option_String(UNUSED CONN_ID Idx)
+{
+       return "";
+#endif
 } /* Option_String */
 
 /**