Fix a couple of unused variable warnings
authorRicardo Mones <ricardo@mones.org>
Sat, 5 May 2018 19:59:55 +0000 (21:59 +0200)
committerRicardo Mones <ricardo@mones.org>
Sat, 5 May 2018 19:59:55 +0000 (21:59 +0200)
- libspamc.c:491:19: warning: variable ‘family’ set but not used
  (used in a #ifdef block, fix by surrounding by same #ifdef)
- libspamc.c:1911:35: warning: unused variable ‘addrp’
  (used in a commented code block, fix by commenting also declaration)

src/plugins/spamassassin/libspamc.c

index 623c1ab..09e52b0 100644 (file)
@@ -488,6 +488,7 @@ static int _try_to_connect_tcp(const struct transport *tp, int *sockptr)
 #ifdef SPAMC_HAS_ADDRINFO
         res = tp->hosts[hostix];
         while(res) {
+#ifdef DO_CONNECT_DEBUG_SYSLOGS
             char *family = NULL;
             switch(res->ai_family) {
             case AF_INET:
@@ -500,6 +501,7 @@ static int _try_to_connect_tcp(const struct transport *tp, int *sockptr)
                 family = "Unknown";
                 break;
             }
+#endif
 
             if ((ret = _opensocket(tp->flags, res, &mysock)) != EX_OK) {
                 res = res->ai_next;
@@ -1908,7 +1910,7 @@ static void _randomize_hosts(struct transport *tp)
 int transport_setup(struct transport *tp, int flags)
 {
 #ifdef SPAMC_HAS_ADDRINFO
-    struct addrinfo hints, *res, *addrp;
+    struct addrinfo hints, *res; /* , *addrp; */
     char port[6];
     int origerr;
 #else