mirror of
https://github.com/tmux/tmux.git
synced 2025-04-07 00:28:48 +00:00
Initialize copy_width before adjusting it, GitHub issue 3079.
This commit is contained in:
parent
f74a98cd07
commit
92a26a8b8c
@ -1154,13 +1154,13 @@ format_trim_right(const char *expanded, u_int limit)
|
|||||||
while (*cp != '\0') {
|
while (*cp != '\0') {
|
||||||
if (*cp == '#') {
|
if (*cp == '#') {
|
||||||
end = format_leading_hashes(cp, &n, &leading_width);
|
end = format_leading_hashes(cp, &n, &leading_width);
|
||||||
|
copy_width = leading_width;
|
||||||
if (width <= skip) {
|
if (width <= skip) {
|
||||||
if (skip - width >= leading_width)
|
if (skip - width >= copy_width)
|
||||||
copy_width = 0;
|
copy_width = 0;
|
||||||
else
|
else
|
||||||
copy_width -= (skip - width);
|
copy_width -= (skip - width);
|
||||||
} else
|
}
|
||||||
copy_width = leading_width;
|
|
||||||
if (copy_width != 0) {
|
if (copy_width != 0) {
|
||||||
if (n == 1)
|
if (n == 1)
|
||||||
*out++ = '#';
|
*out++ = '#';
|
||||||
|
Loading…
Reference in New Issue
Block a user