Skip to content

Fix wordNum off by one when TextBuf entirely full#43

Merged
fincs merged 1 commit intodevkitPro:masterfrom
LiquidFenrir:fix-text-wordnum
Sep 14, 2022
Merged

Fix wordNum off by one when TextBuf entirely full#43
fincs merged 1 commit intodevkitPro:masterfrom
LiquidFenrir:fix-text-wordnum

Conversation

@LiquidFenrir
Copy link
Contributor

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.

@fincs fincs merged commit 1d9b05a into devkitPro:master Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants