Skip to content

Commit

Permalink
fix: get32IntFromBuffer to handle arbitary sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
nanov committed Oct 30, 2019
1 parent 9e20105 commit cae867a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports.get32IntFromBuffer = function (buffer, offset) {
var size = 0;
if ((size = buffer.length - offset) > 0) {
if (size >= 4) {
return buffer.readUInt32BE(offset);
return buffer.readUIntBE(offset, size);
} else {
var res = 0;
for (var i = offset + size, d = 0; i > offset; i--, d += 2) {
Expand Down

0 comments on commit cae867a

Please sign in to comment.