Replace octal parseInt with hex literal
This commit is contained in:
parent
62b439ef8e
commit
ba1982d4a9
10
lib/tput.js
10
lib/tput.js
|
@ -366,7 +366,7 @@ Tput.prototype.parseTerminfo = function(data, file) {
|
||||||
o = 0;
|
o = 0;
|
||||||
for (; i < l; i += 2) {
|
for (; i < l; i += 2) {
|
||||||
v = Tput.numbers[o++];
|
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;
|
info.numbers[v] = -1;
|
||||||
} else {
|
} else {
|
||||||
info.numbers[v] = (data[i + 1] << 8) | data[i];
|
info.numbers[v] = (data[i + 1] << 8) | data[i];
|
||||||
|
@ -379,7 +379,7 @@ Tput.prototype.parseTerminfo = function(data, file) {
|
||||||
o = 0;
|
o = 0;
|
||||||
for (; i < l; i += 2) {
|
for (; i < l; i += 2) {
|
||||||
v = Tput.strings[o++];
|
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;
|
info.strings[v] = -1;
|
||||||
} else {
|
} else {
|
||||||
info.strings[v] = (data[i + 1] << 8) | data[i];
|
info.strings[v] = (data[i + 1] << 8) | data[i];
|
||||||
|
@ -533,7 +533,7 @@ Tput.prototype.parseExtended = function(data) {
|
||||||
var _numbers = [];
|
var _numbers = [];
|
||||||
l = i + h.numCount * 2;
|
l = i + h.numCount * 2;
|
||||||
for (; i < l; i += 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);
|
_numbers.push(-1);
|
||||||
} else {
|
} else {
|
||||||
_numbers.push((data[i + 1] << 8) | data[i]);
|
_numbers.push((data[i + 1] << 8) | data[i]);
|
||||||
|
@ -544,7 +544,7 @@ Tput.prototype.parseExtended = function(data) {
|
||||||
var _strings = [];
|
var _strings = [];
|
||||||
l = i + h.strCount * 2;
|
l = i + h.strCount * 2;
|
||||||
for (; i < l; i += 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);
|
_strings.push(-1);
|
||||||
} else {
|
} else {
|
||||||
_strings.push((data[i + 1] << 8) | data[i]);
|
_strings.push((data[i + 1] << 8) | data[i]);
|
||||||
|
@ -2280,7 +2280,7 @@ function sprintf(src) {
|
||||||
break;
|
break;
|
||||||
case 'c': // char
|
case 'c': // char
|
||||||
param = isFinite(param)
|
param = isFinite(param)
|
||||||
? String.fromCharCode(param || parseInt('0200', 8))
|
? String.fromCharCode(param || 0x80)
|
||||||
: '';
|
: '';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue