From eb5ff5048268ccb548d6b7ce05be8404d1a84112 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 3 Aug 2023 10:40:10 +0300 Subject: [PATCH] bit_stream_reader.c (peek_bits): Remove memset. Not needed after commit 3cc5cca77ba691cd4ba7905e4e938cafc773a106. Also reduce context of fill_bytes and constify it. --- lib/bit_stream_reader.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/bit_stream_reader.c b/lib/bit_stream_reader.c index d8d6a90..34458c9 100644 --- a/lib/bit_stream_reader.c +++ b/lib/bit_stream_reader.c @@ -60,7 +60,6 @@ static int peek_bits(BitStreamReader *reader, unsigned int n) { uint8_t buf[4]; - unsigned int fill_bytes; size_t bytes, i; if (n == 0) { @@ -74,11 +73,10 @@ static int peek_bits(BitStreamReader *reader, // Maximum number of bytes we can fill? - fill_bytes = (32 - reader->bits) / 8; + const unsigned int fill_bytes = (32 - reader->bits) / 8; // Read from input and fill bit_buffer. - memset(buf, 0, sizeof(buf)); bytes = reader->callback(buf, fill_bytes, reader->callback_data);