mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-11 05:33:55 -04:00
render: fix "maybe-uninitialized" error in draw_styled_underline()
Reproducer:
CFLAGS='-Og -g' meson setup --buildtype=debug bld
ninja -C bld
Error message:
../render.c: In function ‘draw_styled_underline’:
../render.c:490:19: error: ‘y_ofs’ may be used uninitialized
[-Werror=maybe-uninitialized]
490 | const int top = y + y_ofs;
| ^~~
../render.c:405:9: note: ‘y_ofs’ was declared here
405 | int y_ofs;
| ^~~~~
This commit is contained in:
parent
ab4b3cbd34
commit
970b95509c
1 changed files with 3 additions and 2 deletions
5
render.c
5
render.c
|
|
@ -420,8 +420,9 @@ draw_styled_underline(const struct terminal *term, pixman_image_t *pix,
|
||||||
|
|
||||||
case UNDERLINE_NONE:
|
case UNDERLINE_NONE:
|
||||||
case UNDERLINE_SINGLE:
|
case UNDERLINE_SINGLE:
|
||||||
BUG("underline styles not supposed to be handled here");
|
default:
|
||||||
break;
|
BUG("unexpected underline style: %d", (int)style);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int ceil_w = cols * term->cell_width;
|
const int ceil_w = cols * term->cell_width;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue