lib/java_string: fix end character issues

BodgeMaster-unfinished
Milan Suman 2022-07-20 08:39:29 +05:30
parent 45538e156a
commit c1b6c3005f
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ namespace JavaCompat {
std::string stdString; std::string stdString;
uint16_t size = static_cast<uint16_t>(data[0])<<8 | static_cast<uint16_t>(data[1]); uint16_t size = static_cast<uint16_t>(data[0])<<8 | static_cast<uint16_t>(data[1]);
for(uint8_t i=2; i<size; i++){ for(uint8_t i=2; i<size+2; i++){
if(i != 0){ if(i != 0){
if(data[i] == 0x80 && data[i-1] == 0xc0){ if(data[i] == 0x80 && data[i-1] == 0xc0){
stdString[stdString.length() - 1] = '\0'; stdString[stdString.length() - 1] = '\0';