lib/java_string: fix end character issues
parent
45538e156a
commit
c1b6c3005f
|
@ -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';
|
||||||
|
|
Loading…
Reference in New Issue