diff options
-rw-r--r-- | fetchmail.h | 4 | ||||
-rw-r--r-- | interface.c | 4 | ||||
-rw-r--r-- | sink.c | 3 | ||||
-rw-r--r-- | transact.c | 5 |
4 files changed, 10 insertions, 6 deletions
diff --git a/fetchmail.h b/fetchmail.h index 11cbc751..aa58bcdd 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -422,8 +422,8 @@ struct msgblk /* message header parsed for open_sink() */ #define NUM_ZERO(n) ((n) < 0) #define NUM_SPECIFIED(n) ((n) != 0) -#define MULTIDROP(ctl) (ctl->wildcard || \ - ((ctl)->localnames && (ctl)->localnames->next)) +#define MULTIDROP(ctl) ((ctl)->wildcard || \ + ((ctl)->localnames && (ctl)->localnames->next)) /* * Note: tags are generated with an a%04d format from a 1-origin diff --git a/interface.c b/interface.c index 287eaf18..7bdd2de6 100644 --- a/interface.c +++ b/interface.c @@ -514,7 +514,7 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo) } sin = (struct sockaddr_in *)info.rti_info[RTAX_NETMASK]; - if (!sin) + if (sin) { ifinfo->netmask = sin->sin_addr; } @@ -524,7 +524,7 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo) * of non point-to-point link */ sin = (struct sockaddr_in *)info.rti_info[RTAX_BRD]; - if (!sin) + if (sin) { ifinfo->dstaddr = sin->sin_addr; } @@ -649,6 +649,9 @@ int stuffline(struct query *ctl, char *buf) int n, oldphase; char *last; + if (!buf) + return -1; + /* The line may contain NUL characters. Find the last char to use * -- the real line termination is the sequence "\n\0". */ @@ -1238,8 +1238,9 @@ process_headers: for (idp = msgblk.recipients; idp; idp = idp->next) if (idp->val.status.mark == XMIT_ACCEPT) break; /* only report first address */ - snprintf(buf+1, sizeof(buf)-1, - "for <%s>", rcpt_address (ctl, idp->id, 1)); + if (idp) + snprintf(buf+1, sizeof(buf)-1, + "for <%s>", rcpt_address (ctl, idp->id, 1)); snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf)-1, " (%s); ", MULTIDROP(ctl) ? "multi-drop" : "single-drop"); |