# HG changeset patch # User Josef 'Jeff' Sipek # Date 1672872582 18000 # Wed Jan 04 17:49:42 2023 -0500 # Node ID 0988c0811f93133fbd07c2a2335edb3a5d962af2 # Parent f197aa6834e4ac34340eeb7ff8e2bae6473399c1 Use ARRAY_LEN instead of sizeof to detect end of fixed tone pattern The two are equivalent for uint8_t, but break if the type changes to something larger. Signed-off-by: Josef 'Jeff' Sipek diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -179,7 +179,7 @@ static inline uint8_t next_fixed_tone(uint8_t tone) { tone++; - if (tone == sizeof(tones_fixed)) + if (tone == ARRAY_LEN(tones_fixed)) tone = 0; return tone;