diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-28 05:44:10 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-28 05:44:10 +0000 |
commit | 596d9c453238ef5e80f2b7f5f414b4aedcbca5cb (patch) | |
tree | 7e2ba7c8473ad2e261264fc72b75d91034862585 /usr.bin/less | |
parent | db251f9c53ebe82df0e02b3d742581fd8b421989 (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 'usr.bin/less')
-rw-r--r-- | usr.bin/less/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/less/main.c b/usr.bin/less/main.c index 5fc7f131803..9820eb5903f 100644 --- a/usr.bin/less/main.c +++ b/usr.bin/less/main.c @@ -303,7 +303,7 @@ easprintf(const char *fmt, ...) rv = vasprintf(&p, fmt, ap); va_end(ap); - if (p == NULL || rv < 0) { + if (rv == -1) { error("Cannot allocate memory", NULL); quit(QUIT_ERROR); } |