mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-10 02:55:46 +00:00
do not gracefully handle bad parse errors.
This commit is contained in:
parent
134ebe28c0
commit
78c2803523
12
lib/tput.js
12
lib/tput.js
@ -223,11 +223,7 @@ Tput.prototype.parseTerminfo = function(data) {
|
|||||||
|
|
||||||
while (data[j]) j++;
|
while (data[j]) j++;
|
||||||
|
|
||||||
// assert.ok(j < data.length, 'Expected ' + j + ' < ' + data.length);
|
assert(j < data.length);
|
||||||
if (j >= data.length) {
|
|
||||||
delete info.strings[key];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
info.strings[key] = data.toString('ascii', s, j);
|
info.strings[key] = data.toString('ascii', s, j);
|
||||||
});
|
});
|
||||||
@ -376,11 +372,7 @@ Tput.prototype.parseExtended = function(data) {
|
|||||||
|
|
||||||
while (data[j]) j++;
|
while (data[j]) j++;
|
||||||
|
|
||||||
// assert.ok(j < data.length, 'Expected ' + j + ' < ' + data.length);
|
assert(j < data.length);
|
||||||
if (j >= data.length) {
|
|
||||||
_strings[k] = '';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find out where the string table ends by
|
// Find out where the string table ends by
|
||||||
// getting the highest string length.
|
// getting the highest string length.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user