From 1a14a6234910ee388574badc7c6a94fd637b21cd Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 24 Jun 2017 17:26:02 +0200 Subject: [PATCH] input/wav: Fix incorrect memset() call. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../src/input/wav.c: In function ‘send_chunk’: ../src/input/wav.c:200:2: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] memset(fdata, 0, CHUNK_SIZE); ^~~~~~ --- src/input/wav.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/wav.c b/src/input/wav.c index 243fd4ca..35247112 100644 --- a/src/input/wav.c +++ b/src/input/wav.c @@ -197,7 +197,7 @@ static void send_chunk(const struct sr_input *in, int offset, int num_samples) s = in->buf->str + offset; d = (char *)fdata; - memset(fdata, 0, CHUNK_SIZE); + memset(fdata, 0, CHUNK_SIZE * sizeof(float)); total_samples = num_samples * inc->num_channels; for (samplenum = 0; samplenum < total_samples; samplenum++) { if (inc->fmt_code == WAVE_FORMAT_PCM_) {