mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Fix issues with NULL char not being treated properly (Thanks tornato)
This commit is contained in:
parent
33c20d26fc
commit
2512479689
@ -72,8 +72,9 @@ namespace MCGalaxy {
|
||||
char* characters = stackalloc char[StringSize];
|
||||
for (int i = StringSize - 1; i >= 0; i--) {
|
||||
byte code = data[i + offset];
|
||||
if( length == 0 && !(code == 0x00 || code == 0x20))
|
||||
length = i + 1;
|
||||
if (code == 0) code = 0x20; // NULL to space
|
||||
|
||||
if (length == 0 && code != 0x20) { length = i + 1; }
|
||||
characters[i] = ((char)code).Cp437ToUnicode();
|
||||
}
|
||||
return new String(characters, 0, length);
|
||||
|
Loading…
x
Reference in New Issue
Block a user