script_number: initialize result to 0

This commit is contained in:
Daniel Cousens 2016-01-05 13:11:49 +11:00
parent 302bbe81ba
commit d7da292063

View file

@ -11,8 +11,6 @@ function decode (buffer, maxLength, minimal) {
}
}
var result
// 40-bit
if (length === 5) {
var a = buffer.readUInt32LE(0)
@ -22,6 +20,8 @@ function decode (buffer, maxLength, minimal) {
return b * 0x100000000 + a
}
var result = 0
// 32-bit / 24-bit / 16-bit / 8-bit
for (var i = 0; i < length; ++i) {
result |= buffer[i] << (8 * i)