From bc1632dc80590baf956156003fb8398c1cc2d268 Mon Sep 17 00:00:00 2001 From: Connor Douthat <7866089+cadouthat@users.noreply.github.com> Date: Thu, 23 Nov 2023 13:43:29 -0800 Subject: [PATCH] Use memcpy instead of copying bytes manually This is cleaner and more efficient, but more importantly it fixes this annoying GCC warning: ``` hfp_hf.c:1561:26: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 1561 | hfp_hf_codecs[i] = codecs[i]; | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~ ``` --- src/classic/hfp_hf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/classic/hfp_hf.c b/src/classic/hfp_hf.c index ce1f748cb8..6ba169eba6 100644 --- a/src/classic/hfp_hf.c +++ b/src/classic/hfp_hf.c @@ -1556,10 +1556,7 @@ void hfp_hf_init_codecs(int codecs_nr, const uint8_t * codecs){ btstack_assert(codecs_nr <= HFP_MAX_NUM_CODECS); hfp_hf_codecs_nr = codecs_nr; - int i; - for (i=0; i