Skip to content

Commit

Permalink
Provide space for terminating nulls with max length chord names
Browse files Browse the repository at this point in the history
C style strings use a terminating null so the buffers need to be at least 1+the length of the longest string long.
  • Loading branch information
worktycho authored Jul 7, 2020
1 parent 62809ce commit 66c2a18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ChordCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ struct ChordCVWidget : ModuleWidget {
struct ChordDisplayWidget : TransparentWidget {
ChordCV* module;
std::shared_ptr<Font> font;
char text[9];
char text[10];

ChordDisplayWidget(Vec _pos, Vec _size, ChordCV* _module) {
box.size = _size;
Expand All @@ -248,7 +248,7 @@ struct ChordCVWidget : ModuleWidget {

int note = module->root_semi;
int type = module->chord_type;
char inv[3];
char inv[4];
if(module->inverted){
sprintf(inv,"/%s",noteNames[module->bass_note]);
}
Expand Down

0 comments on commit 66c2a18

Please sign in to comment.