diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2017-04-12 18:24:38 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2017-04-12 18:24:38 +0000 |
commit | b88a6f8e494d6f4e7510d33807b047b735b5b85f (patch) | |
tree | 49540ea5141668185ddb0a9885031dff7fd7c7bd /lib/libedit/el.c | |
parent | b8cc90c932c4c28117e48591bd1f0624a5a252fa (diff) |
Use calloc(3) and recallocarray(3) instead of *alloc* + memset(0).
ok deraadt
Diffstat (limited to 'lib/libedit/el.c')
-rw-r--r-- | lib/libedit/el.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libedit/el.c b/lib/libedit/el.c index 3999744baa9..2b57de13e6e 100644 --- a/lib/libedit/el.c +++ b/lib/libedit/el.c @@ -1,4 +1,4 @@ -/* $OpenBSD: el.c,v 1.36 2016/05/22 23:09:56 schwarze Exp $ */ +/* $OpenBSD: el.c,v 1.37 2017/04/12 18:24:37 tb Exp $ */ /* $NetBSD: el.c,v 1.61 2011/01/27 23:11:40 christos Exp $ */ /*- @@ -57,13 +57,11 @@ EditLine * el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr) { - EditLine *el = (EditLine *) malloc(sizeof(EditLine)); + EditLine *el = (EditLine *) calloc(1, sizeof(EditLine)); if (el == NULL) return NULL; - memset(el, 0, sizeof(EditLine)); - el->el_infile = fin; el->el_outfile = fout; el->el_errfile = ferr; |