mirror of
https://github.com/tmux/tmux.git
synced 2025-04-13 14:58:50 +00:00
Whoops, get the logic the right way round.
This commit is contained in:
parent
a6fc49ae08
commit
30e8ed393e
@ -1,4 +1,4 @@
|
|||||||
/* $Id: imsg.c,v 1.6 2010-11-11 20:41:08 nicm Exp $ */
|
/* $Id: imsg.c,v 1.7 2010-11-13 16:29:05 nicm Exp $ */
|
||||||
/* $OpenBSD: imsg.c,v 1.3 2010/05/26 13:56:07 nicm Exp $ */
|
/* $OpenBSD: imsg.c,v 1.3 2010/05/26 13:56:07 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -111,7 +111,7 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg)
|
|||||||
return (0);
|
return (0);
|
||||||
datalen = imsg->hdr.len - IMSG_HEADER_SIZE;
|
datalen = imsg->hdr.len - IMSG_HEADER_SIZE;
|
||||||
ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE;
|
ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE;
|
||||||
if (datalen != 0 && (imsg->data = malloc(datalen + 1)) == NULL)
|
if ((imsg->data = malloc(datalen)) == NULL && datalen != 0)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
if (imsg->hdr.flags & IMSGF_HASFD)
|
if (imsg->hdr.flags & IMSGF_HASFD)
|
||||||
|
Loading…
Reference in New Issue
Block a user