From 78c2803523483ce15d60bd175c9a33087ffe44da Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 6 Mar 2013 04:03:07 -0600 Subject: [PATCH] do not gracefully handle bad parse errors. --- lib/tput.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/tput.js b/lib/tput.js index 299963c..482429f 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -223,11 +223,7 @@ Tput.prototype.parseTerminfo = function(data) { while (data[j]) j++; - // assert.ok(j < data.length, 'Expected ' + j + ' < ' + data.length); - if (j >= data.length) { - delete info.strings[key]; - return; - } + assert(j < data.length); info.strings[key] = data.toString('ascii', s, j); }); @@ -376,11 +372,7 @@ Tput.prototype.parseExtended = function(data) { while (data[j]) j++; - // assert.ok(j < data.length, 'Expected ' + j + ' < ' + data.length); - if (j >= data.length) { - _strings[k] = ''; - return; - } + assert(j < data.length); // Find out where the string table ends by // getting the highest string length.