Fix wrong result caused by newline character.
Merge pull request #1 from whatevsz/fix

Fix wrong result caused by null byte character.