Permalink
Browse files

fix unpack() to work with shorts (Ssv): add missing parenthesis aroun…

…d bit shift
  • Loading branch information...
1 parent d540f20 commit e22698ecb7b30bb1305ecfacbefe48d8a09f2c35 deadbyte committed Nov 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 _workbench/misc/unpack.js
@@ -166,7 +166,7 @@ function unpack(format, data) {
for (i=0;i<currentData.length;i+=2) {
// sum per word;
- currentResult = (currentData.charCodeAt(i+1) & 0xFF) << 8 +
+ currentResult = ((currentData.charCodeAt(i+1) & 0xFF) << 8) +
(currentData.charCodeAt(i) & 0xFF);
if ((instruction === 's') && (currentResult >= 32768)) {
currentResult -= 65536;

0 comments on commit e22698e

Please sign in to comment.