Skip to content

Commit

Permalink
Add explanatory comment
Browse files Browse the repository at this point in the history
In response to @dcposch's feedback
  • Loading branch information
feross committed Aug 8, 2016
1 parent 6218f71 commit 50b0526
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ function fromString (that, string, encoding) {
var actual = that.write(string, encoding)

if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
that = that.slice(0, actual)
}

Expand Down

0 comments on commit 50b0526

Please sign in to comment.