if (res < 0) {
log_error("send_one_fd: sendmsg error: %s", strerror(errno));
return false;
- } else if (res != iovec.iov_len) {
+ } else if ((size_t)res != iovec.iov_len) {
log_error("send_one_fd: partial sendmsg");
return false;
}
/* extract substring from regex group */
static void copy_arg(const char *src, regmatch_t *glist,
- int gnum, char *dst, int dstmax)
+ int gnum, char *dst, unsigned dstmax)
{
regmatch_t *g = &glist[gnum];
unsigned len = g->rm_eo - g->rm_so;
static inline const uint8 * mbuf_get_bytes(MBuf *buf, unsigned len)
{
const uint8 *res = buf->pos;
- if (len > buf->end - buf->pos)
+ if (buf->pos + len > buf->end)
fatal("buffer overflow");
buf->pos += len;
return res;