Skip to content
Myr

render: fix crash when 'tabs = 0'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

When tabs is 0, and there's a tab character in the entry name, fuzzel crashes. This happens because we divide the current cluster's length with the tab count (modulus, really). Simply set chars_to_next_tab_stop to 0 when tabs is 0. Closes #348

authored by Daniel Eklöf · committed by Daniel Eklöf · parent 7e9e8aa · Browse files · 2 files+6 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−1 removed

  • other:+6 added−1 removed

2 files+6 added−1 removed

modified:CHANGELOG.md+3 added
52 unmodified lines
5354* PNG images being way too dark.55* Crash when the cache contains strings that are not valid in the56 current locale ([#337][337]).57* Crash when `tabs` (in `fuzzel.ini`) is set to `0` ([#348][348]).5859[348]: https://codeberg.org/dnkl/fuzzel/issues/348606162### Security63### Contributors6465
646 unmodified lines
modified:render.c+3 added-1 removed
330 unmodified lines
331 const struct fcft_glyph *space =332 fcft_rasterize_char_utf32(font, U' ', subpixel);333334 if (space != NULL) {335 const size_t chars_to_next_tab_stop = tabs - (clusters[i] % tabs);335 const size_t chars_to_next_tab_stop = tabs == 0336 ? 0337 : tabs - (clusters[i] % tabs);338 x += chars_to_next_tab_stop * space->advance.x;339 }340341 continue;
525 unmodified lines