GRIM/EMI: Fix word wrapping in the case when there are no spaces in the text.

This always caused a buffer overflow before.
Merge pull request #1052 from Akz-/textobject-fix

GRIM/EMI: Text wrapping fixes