diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-07 01:14:22 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-07 01:14:22 +0000 |
commit | 323bc0efb519e53a3ae0e6770252907cb6148cf3 (patch) | |
tree | cee0440abde22384c0dad3f6009ce2058dbf9c69 | |
parent | 986b1612d6298c80decacd1e23b4c55dd6dcaa01 (diff) |
use calloc. from Peter Malone
-rw-r--r-- | lib/libusbhid/parse.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libusbhid/parse.c b/lib/libusbhid/parse.c index 08ac1864d9a..0a0bfe7a84d 100644 --- a/lib/libusbhid/parse.c +++ b/lib/libusbhid/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.7 2012/07/16 19:57:17 jasper Exp $ */ +/* $OpenBSD: parse.c,v 1.8 2014/05/07 01:14:21 tedu Exp $ */ /* $NetBSD: parse.c,v 1.2 2001/12/29 20:44:22 augustss Exp $ */ /* @@ -91,10 +91,9 @@ hid_start_parse(report_desc_t d, int kindset, int id) { struct hid_data *s; - s = malloc(sizeof *s); + s = calloc(1, sizeof *s); if (s == NULL) return (NULL); - memset(s, 0, sizeof *s); s->start = s->p = d->data; s->end = d->data + d->size; s->kindset = kindset; |