Browse Source

Add another check for invalid input

(std::stoi ignores subsequent symbols)
tags/v0.4.0
ben 7 years ago
parent
commit
5e16c84720
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/core/MidiInterface.cpp

+ 1
- 1
src/core/MidiInterface.cpp View File

@@ -629,7 +629,7 @@ void CCTextField::draw(NVGcontext *vg) {
try { try {
*ccNum = std::stoi(text); *ccNum = std::stoi(text);
// Only allow valid cc numbers // Only allow valid cc numbers
if (*ccNum < 0 || *ccNum > 127) {
if (*ccNum < 0 || *ccNum > 127 || text.size() > 3) {
text = ""; text = "";
begin = end = 0; begin = end = 0;
} }


Loading…
Cancel
Save