diff options
| author | Craig Barnes <craigbarnes@protonmail.com> | 2024-07-03 05:55:01 +0000 |
|---|---|---|
| committer | Craig Barnes <craigbarnes@protonmail.com> | 2024-07-03 05:55:01 +0000 |
| commit | 970b95509c0ddb8dcf3733f3f27eb78da792a296 (patch) | |
| tree | 171773d6703eca983aa1d0e68d4ea9bcc04c5749 | |
| parent | doc: foot-ctlseq: add missing "E" to DECRQSS sequence (diff) | |
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;
| ^~~~~
| -rw-r--r-- | render.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -420,8 +420,9 @@ draw_styled_underline(const struct terminal *term, pixman_image_t *pix, case UNDERLINE_NONE: case UNDERLINE_SINGLE: - BUG("underline styles not supposed to be handled here"); - break; + default: + BUG("unexpected underline style: %d", (int)style); + return; } const int ceil_w = cols * term->cell_width; |
