summaryrefslogtreecommitdiffstats
authornicm <nicm>2010-11-13 16:29:05 (GMT)
committer Raghavendra D Prabhu <[email protected]>2011-01-02 18:59:31 (GMT)
commit103d1835d5d36925b7c018e18f96deb9d33b0f29 (patch) (side-by-side diff)
tree1de94512caa8b5934423e924bd3e48130b1c8ae7
parent5ce46c36b4041566972501495b7e29185a8e5124 (diff)
downloadtmux-old-103d1835d5d36925b7c018e18f96deb9d33b0f29.zip
tmux-old-103d1835d5d36925b7c018e18f96deb9d33b0f29.tar.gz
tmux-old-103d1835d5d36925b7c018e18f96deb9d33b0f29.tar.bz2
Whoops, get the logic the right way round.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--compat/imsg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compat/imsg.c b/compat/imsg.c
index 95a2419..e826043 100644
--- a/compat/imsg.c
+++ b/compat/imsg.c
@@ -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 $ */
/*
@@ -111,7 +111,7 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg)
return (0);
datalen = imsg->hdr.len - 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);
if (imsg->hdr.flags & IMSGF_HASFD)