Skip to content

Commit

Permalink
[hid] Added capturing parentheses around the matching regex for the t…
Browse files Browse the repository at this point in the history
…wo hex characters.
  • Loading branch information
beaufortfrancois committed Apr 14, 2015
1 parent 02dc546 commit 5c5b7a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/hid/control-panel.js
Expand Up @@ -111,7 +111,7 @@
var id = +ui.outId.value;
var bytes = new Uint8Array(+ui.outSize.value);
var contents = ui.outData.value;
contents = contents.replace(/\\x[a-fA-F0-9]{2}/g, function(match, capture) {
contents = contents.replace(/\\x([a-fA-F0-9]{2})/g, function(match, capture) {
return String.fromCharCode(parseInt(capture, 16));
});
for (var i = 0; i < contents.length && i < bytes.length; ++i) {
Expand Down

0 comments on commit 5c5b7a7

Please sign in to comment.