Commit 14a6f8f
committed
menu/rgui: convert OSK fallback messagebox build to strlcpy_append
The fallback path in rgui_render_osk that triggers when the on-screen
keyboard cannot fit on the framebuffer was building its message via
the unsafe `*pos += strlcpy(buf + *pos, src, len - *pos)` pattern.
The construction was sound here because msg is large
(NAME_MAX_LENGTH) and inputs are short, but the same string-build
shape is what strlcpy_append exists to replace -- it's bound-checked,
short-circuits cleanly on truncation, and avoids the off-by-one
arithmetic around the embedded '\n'.
Mirrors materialui_render's identical construction at materialui.c
line ~8091, which was already converted in the strlcpy_append
chain-conversion sweeps (commits 25ade82 / e446242 / 78c52ab).1 parent 0e64839 commit 14a6f8f
1 file changed
Lines changed: 4 additions & 6 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4786 | 4786 | | |
4787 | 4787 | | |
4788 | 4788 | | |
4789 | | - | |
4790 | | - | |
4791 | | - | |
4792 | | - | |
4793 | | - | |
4794 | | - | |
| 4789 | + | |
| 4790 | + | |
| 4791 | + | |
| 4792 | + | |
4795 | 4793 | | |
4796 | 4794 | | |
4797 | 4795 | | |
| |||
0 commit comments