From 3848b6b43edbef394acf3fc45aa753c67583057e Mon Sep 17 00:00:00 2001 From: miko Date: Tue, 18 Sep 2018 04:29:58 +0000 Subject: [PATCH] clear p->ctx array with memset(); ok ratchov@ --- usr.bin/aucat/dsp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/aucat/dsp.c b/usr.bin/aucat/dsp.c index 3602cb6a13f..c231fc2f7db 100644 --- a/usr.bin/aucat/dsp.c +++ b/usr.bin/aucat/dsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsp.c,v 1.11 2016/09/30 08:43:23 ratchov Exp $ */ +/* $OpenBSD: dsp.c,v 1.12 2018/09/18 04:29:58 miko Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * @@ -14,6 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include "dsp.h" #include "utils.h" @@ -403,7 +404,7 @@ void resamp_init(struct resamp *p, unsigned int iblksz, unsigned int oblksz, int nch) { - unsigned int i, g; + unsigned int g; /* * reduce iblksz/oblksz fraction @@ -425,8 +426,7 @@ resamp_init(struct resamp *p, unsigned int iblksz, p->diff = 0; p->nch = nch; p->ctx_start = 0; - for (i = 0; i < NCHAN_MAX * RESAMP_NCTX; i++) - p->ctx[i] = 0; + memset(p->ctx, 0, sizeof(p->ctx)); #ifdef DEBUG if (log_level >= 3) { log_puts("resamp: "); -- 2.20.1