Fix possible buffer overflow.
Merge pull request #31 from Alcaro/master

Fix possible buffer overflow.