From ba1982d4a9243700bd4e6b27f169c3c96d084cd9 Mon Sep 17 00:00:00 2001 From: Dan Kaplun Date: Mon, 4 Jan 2016 02:50:49 -0500 Subject: [PATCH] Replace octal parseInt with hex literal --- lib/tput.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/tput.js b/lib/tput.js index 37f512f..0308649 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -366,7 +366,7 @@ Tput.prototype.parseTerminfo = function(data, file) { o = 0; for (; i < l; i += 2) { v = Tput.numbers[o++]; - if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) { + if (data[i + 1] === 0xff && data[i] === 0xff) { info.numbers[v] = -1; } else { info.numbers[v] = (data[i + 1] << 8) | data[i]; @@ -379,7 +379,7 @@ Tput.prototype.parseTerminfo = function(data, file) { o = 0; for (; i < l; i += 2) { v = Tput.strings[o++]; - if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) { + if (data[i + 1] === 0xff && data[i] === 0xff) { info.strings[v] = -1; } else { info.strings[v] = (data[i + 1] << 8) | data[i]; @@ -533,7 +533,7 @@ Tput.prototype.parseExtended = function(data) { var _numbers = []; l = i + h.numCount * 2; for (; i < l; i += 2) { - if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) { + if (data[i + 1] === 0xff && data[i] === 0xff) { _numbers.push(-1); } else { _numbers.push((data[i + 1] << 8) | data[i]); @@ -544,7 +544,7 @@ Tput.prototype.parseExtended = function(data) { var _strings = []; l = i + h.strCount * 2; for (; i < l; i += 2) { - if (data[i + 1] === parseInt('0377', 8) && data[i] === parseInt('0377', 8)) { + if (data[i + 1] === 0xff && data[i] === 0xff) { _strings.push(-1); } else { _strings.push((data[i + 1] << 8) | data[i]); @@ -2280,7 +2280,7 @@ function sprintf(src) { break; case 'c': // char param = isFinite(param) - ? String.fromCharCode(param || parseInt('0200', 8)) + ? String.fromCharCode(param || 0x80) : ''; break; }