diff options
author | nicm <nicm> | 2022-02-22 11:07:25 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2022-04-06 14:19:50 +0100 |
commit | 92a26a8b8c4b32223fb81d7bde93c986ff4f7f6b (patch) | |
tree | 519baa5c3ab03f65ad54821f5486ff3710722883 /format-draw.c | |
parent | f74a98cd077c301b27c18a0a98620f7eda003489 (diff) | |
download | rtmux-92a26a8b8c4b32223fb81d7bde93c986ff4f7f6b.tar.gz rtmux-92a26a8b8c4b32223fb81d7bde93c986ff4f7f6b.tar.bz2 rtmux-92a26a8b8c4b32223fb81d7bde93c986ff4f7f6b.zip |
Initialize copy_width before adjusting it, GitHub issue 3079.
Diffstat (limited to 'format-draw.c')
-rw-r--r-- | format-draw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/format-draw.c b/format-draw.c index 1110535f..1a7e60b3 100644 --- a/format-draw.c +++ b/format-draw.c @@ -1154,13 +1154,13 @@ format_trim_right(const char *expanded, u_int limit) while (*cp != '\0') { if (*cp == '#') { end = format_leading_hashes(cp, &n, &leading_width); + copy_width = leading_width; if (width <= skip) { - if (skip - width >= leading_width) + if (skip - width >= copy_width) copy_width = 0; else copy_width -= (skip - width); - } else - copy_width = leading_width; + } if (copy_width != 0) { if (n == 1) *out++ = '#'; |