Skip to content

Commit

Permalink
leds: Fix cipher transition crashing when a strip has 0 length
Browse files Browse the repository at this point in the history
Fix: Fix a crash in LEDs Cipher transition when front or rear strips
 have 0 LEDs configured.
  • Loading branch information
lukash committed Apr 13, 2024
1 parent 2411e08 commit d00981c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion refloat/refloat/leds.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static uint32_t color_wheel(uint8_t pos) {
}

static void sattolo_shuffle(uint32_t seed, uint8_t *array, uint8_t length) {
for (uint8_t i = length - 1; i > 0; --i) {
for (int16_t i = length - 1; i > 0; --i) {
uint8_t j = rnd(seed + i) % i;
uint8_t t = array[i];
array[i] = array[j];
Expand Down

0 comments on commit d00981c

Please sign in to comment.