summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/xmalloc.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-06-28 05:44:09 +0000
committerderaadt <deraadt@openbsd.org>2019-06-28 05:44:09 +0000
commit7d5bbbe355add9c0be6e56c06f1818bf2448d48c (patch)
tree6c42284d37e7d3cc246c5d1019a9695b374f2df7 /usr.bin/tmux/xmalloc.c
parentmkstemp() returns -1 on failure (diff)
downloadwireguard-openbsd-7d5bbbe355add9c0be6e56c06f1818bf2448d48c.tar.xz
wireguard-openbsd-7d5bbbe355add9c0be6e56c06f1818bf2448d48c.zip
asprintf returns -1, not an arbitrary value < 0. Also upon error the
(very sloppy specification) leaves an undefined value in *ret, so it is wrong to inspect it, the error condition is enough. discussed a little with nicm, and then much more with millert until we were exasperated
Diffstat (limited to 'usr.bin/tmux/xmalloc.c')
-rw-r--r--usr.bin/tmux/xmalloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/xmalloc.c b/usr.bin/tmux/xmalloc.c
index 367db15ea52..0871b7c7e19 100644
--- a/usr.bin/tmux/xmalloc.c
+++ b/usr.bin/tmux/xmalloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xmalloc.c,v 1.11 2016/11/17 10:06:08 nicm Exp $ */
+/* $OpenBSD: xmalloc.c,v 1.12 2019/06/28 05:44:09 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -111,7 +111,7 @@ xvasprintf(char **ret, const char *fmt, va_list ap)
i = vasprintf(ret, fmt, ap);
- if (i < 0 || *ret == NULL)
+ if (i == -1)
fatalx("xasprintf: %s", strerror(errno));
return i;