Replace octal parseInt with hex literal

This commit is contained in:
Dan Kaplun 2016-01-04 02:50:49 -05:00
parent 62b439ef8e
commit ba1982d4a9
1 changed files with 5 additions and 5 deletions

View File

@ -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;
}