diff --git a/core/usb/dusb.c b/core/usb/dusb.c index 9f52ea055..4a4076aa3 100644 --- a/core/usb/dusb.c +++ b/core/usb/dusb.c @@ -234,7 +234,9 @@ static bool dusb_convert_varname_to_utf8(dusb_command_t *command) { return false; } fallthrough; - default: + case CALC_VAR_TYPE_PROG: + case CALC_VAR_TYPE_PROT_PROG: + case CALC_VAR_TYPE_TEMP_PROG: if (command->varname[0] < 'A' || command->varname[0] > 'Z' + 1) { return false; } @@ -341,6 +343,13 @@ static bool dusb_convert_varname_to_utf8(dusb_command_t *command) { tiascii[5] += 1 + command->varname[1]; } break; + default: + if (command->varname[0] < 'A' || (command->varname[0] > 'Z' + 1 && command->varname[0] < 'a') || command->varname[0] > 'z') { + return false; + } + memcpy(tiascii, command->varname, command->varname_length); + tiascii[command->varname_length] = '\0'; + break; } command->varname_utf8_length = 0;