Skip to content

Commit e22698e

Browse files
author
deadbyte
committed
fix unpack() to work with shorts (Ssv): add missing parenthesis around bit shift
1 parent d540f20 commit e22698e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_workbench/misc/unpack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function unpack(format, data) {
166166

167167
for (i=0;i<currentData.length;i+=2) {
168168
// sum per word;
169-
currentResult = (currentData.charCodeAt(i+1) & 0xFF) << 8 +
169+
currentResult = ((currentData.charCodeAt(i+1) & 0xFF) << 8) +
170170
(currentData.charCodeAt(i) & 0xFF);
171171
if ((instruction === 's') && (currentResult >= 32768)) {
172172
currentResult -= 65536;

0 commit comments

Comments
 (0)