From 92c7adc989de7eeba4c57e7fbd3840dfb36e017d Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Thu, 14 Nov 2019 10:42:21 +0100 Subject: [PATCH] Small fixes. --- dexed_sysex.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dexed_sysex.cpp b/dexed_sysex.cpp index 6175078..5199371 100644 --- a/dexed_sysex.cpp +++ b/dexed_sysex.cpp @@ -223,13 +223,13 @@ bool load_sysex(uint8_t b, uint8_t v, uint8_t instance_id) #if DEBUG bool found = false; #endif - v %= MAX_VOICES; - b %= MAX_BANKS; + v = constrain(v, 1, MAX_VOICES); + b = constrain(b, 1, MAX_BANKS); if (sd_card_available) { File sysex; - char sysex_file_name[4 + VOICE_NAME_LEN]; + char sysex_file_name[10 + VOICE_NAME_LEN]; uint8_t data[128]; create_sysex_filename(b, sysex_file_name, instance_id);