Improve null splitting on rfactor

This commit is contained in:
mmorrison 2019-02-04 01:16:30 -06:00
parent 81750805f6
commit 82084ad38e
2 changed files with 4 additions and 4 deletions

View file

@ -68,7 +68,8 @@ class Rfactor extends Core {
// Consumes bytesToConsume, but only returns string up to the first null
readString(reader, bytesToConsume) {
return reader.string(bytesToConsume).replace(/\0.*$/g,'');
const consumed = reader.part(bytesToConsume);
return this.reader(consumed).string();
}
}