script_number: initialize result to 0
This commit is contained in:
parent
302bbe81ba
commit
d7da292063
1 changed files with 2 additions and 2 deletions
|
@ -11,8 +11,6 @@ function decode (buffer, maxLength, minimal) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var result
|
|
||||||
|
|
||||||
// 40-bit
|
// 40-bit
|
||||||
if (length === 5) {
|
if (length === 5) {
|
||||||
var a = buffer.readUInt32LE(0)
|
var a = buffer.readUInt32LE(0)
|
||||||
|
@ -22,6 +20,8 @@ function decode (buffer, maxLength, minimal) {
|
||||||
return b * 0x100000000 + a
|
return b * 0x100000000 + a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var result = 0
|
||||||
|
|
||||||
// 32-bit / 24-bit / 16-bit / 8-bit
|
// 32-bit / 24-bit / 16-bit / 8-bit
|
||||||
for (var i = 0; i < length; ++i) {
|
for (var i = 0; i < length; ++i) {
|
||||||
result |= buffer[i] << (8 * i)
|
result |= buffer[i] << (8 * i)
|
||||||
|
|
Loading…
Reference in a new issue