Skip to content

Commit

Permalink
fix unpack() to work with shorts (Ssv): add missing parenthesis aroun…
Browse files Browse the repository at this point in the history
…d bit shift
  • Loading branch information
deadbyte committed Nov 26, 2012
1 parent d540f20 commit e22698e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _workbench/misc/unpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e22698e

Please sign in to comment.