aboutsummaryrefslogtreecommitdiffstats
path: root/transact.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2011-05-04 12:10:59 +0200
committerMatthias Andree <matthias.andree@gmx.de>2011-05-04 12:10:59 +0200
commit38c2bcf5da548b953063fd651ec3d0ebb52c73f8 (patch)
tree68bf96e8748639a7db793c3b28bf9cdc8d2a4edb /transact.c
parent646f36e1c1369fd65c0d641cae48fa4425613462 (diff)
downloadfetchmail-38c2bcf5da548b953063fd651ec3d0ebb52c73f8.tar.gz
fetchmail-38c2bcf5da548b953063fd651ec3d0ebb52c73f8.tar.bz2
fetchmail-38c2bcf5da548b953063fd651ec3d0ebb52c73f8.zip
Make macro expansions safer for VALID_ADDRESS and RBUF_WRITE.
Diffstat (limited to 'transact.c')
-rw-r--r--transact.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/transact.c b/transact.c
index 8f25b9d1..b20cfd05 100644
--- a/transact.c
+++ b/transact.c
@@ -201,7 +201,7 @@ static void find_server_names(const char *hdr,
* are not uncommon. So now we just check that the following token is
* not itself an email address.
*/
-#define VALID_ADDRESS(a) !strchr(a, '@')
+#define VALID_ADDRESS(a) (!strchr((a), '@'))
static char *parse_received(struct query *ctl, char *bufp)
/* try to extract real address from the Received line */
@@ -217,7 +217,7 @@ static char *parse_received(struct query *ctl, char *bufp)
static char rbuf[HOSTLEN + USERNAMELEN + 4];
struct addrinfo *ai0;
-#define RBUF_WRITE(value) if (tp < rbuf+sizeof(rbuf)-1) *tp++=value
+#define RBUF_WRITE(value) do { if (tp < rbuf+sizeof(rbuf)-1) *tp++=(value); } while(0)
/*
* Try to extract the real envelope addressee. We look here