fix out-of-bounds access in string display functions. close #1675.
Merge pull request #1801 from thiagohersan/fix-drawString

fix out-of-bounds access in string display functions. close #1675.