citro2d
citro2d copied to clipboard
Fix wordNum off by one when TextBuf entirely full
When the last word of a text is longer than the remaining capacity of the C2D_TextBuf, text->words == glyph->wordNo causing out of bounds access in the alloca'd arrays when drawing the glyphs of this word, resulting in crashes.
This PR ensures the words member of the C2D_Text has the correct value, even when the while loop exits from its condition (no remaining capacity) instead of the break on line end/string end.