Fixes after feedback

10.3.x-maintenance
KiteAnton 2016-07-14 21:46:41 +02:00
parent 6334e1a3e9
commit c22b69e7b5
1 changed files with 6 additions and 7 deletions

View File

@ -737,13 +737,9 @@ var MSP = {
case MSP_codes.MSP_NAME:
var offset = 0;
var name = '';
var letter;
do {
letter = String.fromCharCode(data.getUint8(offset++));
if (letter != '\0') {
name += letter;
}
} while (letter != '\0');
while (offset<data.byteLength) {
name += String.fromCharCode(data.getUint8(offset++));;
}
CONFIG.name = name;
break;
@ -1510,6 +1506,9 @@ MSP.crunch = function (code) {
for (var i = 0; i<CONFIG.name.length; i++) {
buffer.push(CONFIG.name.charCodeAt(i));
}
if (!buffer.length) {
buffer.push('-'.charCodeAt(0));
}
break;