diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-27 18:03:38 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-27 18:03:38 +0000 |
commit | 2fc3f2b1c35e38cea5062540da864e5c6083c4ec (patch) | |
tree | 896dd1804f62ec4576a5b845767f9eec7630c40b /bin/ksh | |
parent | 32cade518fa1930ef2acf6d3220fc6bf6d36f24e (diff) |
Some asprintf() calls were checked < 0, rather than the precise == -1.
ok millert nicm tb, etc
Diffstat (limited to 'bin/ksh')
-rw-r--r-- | bin/ksh/edit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ksh/edit.c b/bin/ksh/edit.c index 2245e0e2049..a7a6c200f0c 100644 --- a/bin/ksh/edit.c +++ b/bin/ksh/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.67 2018/12/30 23:09:58 guenther Exp $ */ +/* $OpenBSD: edit.c,v 1.68 2019/06/27 18:03:36 deraadt Exp $ */ /* * Command line editing - common code @@ -614,12 +614,12 @@ x_try_array(const char *buf, int buflen, const char *want, int wantlen, } /* Try to find the array. */ - if (asprintf(&name, "complete_%.*s_%d", cmdlen, cmd, n) < 0) + if (asprintf(&name, "complete_%.*s_%d", cmdlen, cmd, n) == -1) internal_errorf("unable to allocate memory"); v = global(name); free(name); if (~v->flag & (ISSET|ARRAY)) { - if (asprintf(&name, "complete_%.*s", cmdlen, cmd) < 0) + if (asprintf(&name, "complete_%.*s", cmdlen, cmd) == -1) internal_errorf("unable to allocate memory"); v = global(name); free(name); |