summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
423936d)
Introduce a new macro SBUF which currently refers to bufs[b]. We are
going to change its definition in a moment. Splitting the patches up
this way makes it easier to see that they're right.
No functional change in this patch.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
b++;
b &= IPADDR_NBUFS-1;
b++;
b &= IPADDR_NBUFS-1;
}
/* The string buffer must be at least 16 bytes long */
}
/* The string buffer must be at least 16 bytes long */
assert(ia->sa.sa_family == AF_INET);
assert(ia->sa.sa_family == AF_INET);
- snprintf(bufs[b], sizeof(bufs[b]), "[%s]:%d",
+ snprintf(SBUF, sizeof(SBUF), "[%s]:%d",
inet_ntoa(ia->sin.sin_addr),
ntohs(ia->sin.sin_port));
inet_ntoa(ia->sin.sin_addr),
ntohs(ia->sin.sin_port));
- char *addrbuf = bufs[b];
*addrbuf++ = '[';
int addrbuflen = ADNS_ADDR2TEXT_BUFLEN;
*addrbuf++ = '[';
int addrbuflen = ADNS_ADDR2TEXT_BUFLEN;
int addrl = strlen(addrbuf);
portbuf += addrl;
int addrl = strlen(addrbuf);
portbuf += addrl;
- snprintf(portbuf, sizeof(bufs[b])-addrl, "]:%d", port);
+ snprintf(portbuf, sizeof(SBUF)-addrl, "]:%d", port);
}
bool_t iaddr_equal(const union iaddr *ia, const union iaddr *ib,
}
bool_t iaddr_equal(const union iaddr *ia, const union iaddr *ib,
+#define SBUF (bufs[b]) /* temporary macro */
+
/*----- line-buffered asynch input -----*/
enum async_linebuf_result {
/*----- line-buffered asynch input -----*/
enum async_linebuf_result {