From 3a181c2020e2cedfe3b62c580297e70a0b1714f6 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Mon, 17 May 2021 10:02:25 -0500 Subject: [PATCH] Fix minor bug in layer deactivation There was a call to `memmove()` call that shifted one extra byte of memory whenever a layer was deactivated. I don't think that `memmove()` would actually overwrite the source byte, so it shouldn't have any visible effect, but this is more correct. Signed-off-by: Michael Richters --- src/kaleidoscope/layers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kaleidoscope/layers.cpp b/src/kaleidoscope/layers.cpp index 9a98fd85..414ce5af 100644 --- a/src/kaleidoscope/layers.cpp +++ b/src/kaleidoscope/layers.cpp @@ -219,7 +219,7 @@ void Layer_::deactivate(uint8_t layer) { // above it down to fill in the gap for (uint8_t i = 0; i < active_layer_count_; ++i) { if (active_layers_[i] == layer) { - memmove(&active_layers_[i], &active_layers_[i + 1], active_layer_count_ - i); + memmove(&active_layers_[i], &active_layers_[i + 1], active_layer_count_ - (i + 1)); --active_layer_count_; break; }