assert(n < HTTP_HDR_MAX);
AN(fm);
- to->hd[n].b = (void*)(uintptr_t)fm;
- to->hd[n].e = (void*)(uintptr_t)strchr(fm, '\0');
+ to->hd[n].b = TRUST_ME(fm);
+ to->hd[n].e = strchr(to->hd[n].b, '\0');
to->hdf[n] = 0;
}
void TCP_name(const struct sockaddr *addr, unsigned l, char *abuf, unsigned alen, char *pbuf, unsigned plen);
void TCP_myname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen);
int TCP_filter_http(int sock);
+
+#define TRUST_ME(ptr) ((void*)(uintptr_t)(ptr))
}
static void
-vsl_hdr(enum shmlogtag tag, unsigned char *p, unsigned len, int id)
+vsl_hdr(enum shmlogtag tag, unsigned char *p, unsigned len, unsigned id)
{
p[__SHMLOG_LEN_HIGH] = (len >> 8) & 0xff;
va_start(ap, fmt);
if (strchr(fmt, '%') == NULL) {
- t.b = (void*)(uintptr_t)fmt;
- t.e = strchr(fmt, '\0');
+ t.b = TRUST_ME(fmt);
+ t.e = strchr(t.b, '\0');
VSLR(tag, id, t);
} else {
LOCKSHM(&vsl_mtx);
va_start(ap, fmt);
if (strchr(fmt, '%') == NULL) {
- t.b = (void*)(uintptr_t)fmt;
- t.e = strchr(fmt, '\0');
+ t.b = TRUST_ME(fmt);
+ t.e = strchr(t.b, '\0');
WSLR(w, tag, id, t);
} else {
assert(w->wlp < w->wle);