Skip to content

Commit

Permalink
Fixing problem with last character being a number
Browse files Browse the repository at this point in the history
  • Loading branch information
bahamas10 committed Jul 10, 2012
1 parent 868d911 commit 51a0932
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -37,7 +37,7 @@ module.exports.unpack = function(fmt, buf, pos) {
if (type == +type) {
// A length is given
length = (length) ? length+type : ''+type;
continue;
if (i !== fmt.length - 1) continue;
}
length = +length || 1;

Expand All @@ -49,6 +49,7 @@ module.exports.unpack = function(fmt, buf, pos) {

// Push the data
ret.push(data);
if (i === fmt.length - 1) return ret;
// reset
flag = null, length = null, data = null;
}
Expand Down

0 comments on commit 51a0932

Please sign in to comment.