summaryrefslogtreecommitdiffstats
path: root/xmalloc.c
diff options
context:
space:
mode:
authorderaadt <deraadt>2019-06-28 05:44:09 +0000
committerderaadt <deraadt>2019-06-28 05:44:09 +0000
commit6ce38b73956836c26c8914cdf5002da7900a5d2d (patch)
tree9b54834d334e21cf396da47f091fea2ccb2eb6e0 /xmalloc.c
parentb434692db20e6ef279ca13b6d25b0d519ac2c134 (diff)
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 'xmalloc.c')
-rw-r--r--xmalloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmalloc.c b/xmalloc.c
index 22ea3540..f249e397 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -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;