DynamicMacros: Do not read past storage_size_ when updating our map

When updating our map via Focus, do not read past `storage_size_`, because we do
not want to clobber storage space past our slice by accident.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/1179/head
Gergely Nagy 3 years ago
parent fd0795f375
commit 2dbf0f807b
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -272,7 +272,7 @@ EventHandlerResult DynamicMacros::onFocusEvent(const char *command) {
} else { } else {
uint16_t pos = 0; uint16_t pos = 0;
while (!::Focus.isEOL()) { while (!::Focus.isEOL() && pos < storage_size_) {
uint8_t b; uint8_t b;
::Focus.read(b); ::Focus.read(b);

Loading…
Cancel
Save