mirror of
https://github.com/tmux/tmux.git
synced 2026-09-21 12:28:14 +00:00
Do not loop forever if someone tries to give WCHAR_MAX a width, GitHub issue
5602.
This commit is contained in:
9
utf8.c
9
utf8.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: utf8.c,v 1.72 2026/09/01 12:49:49 nicm Exp $ */
|
||||
/* $OpenBSD: utf8.c,v 1.73 2026/09/20 08:11:00 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -373,8 +373,13 @@ utf8_add_to_width_cache(const char *s)
|
||||
wc_end = wc_start;
|
||||
}
|
||||
|
||||
for (wc = wc_start; wc <= wc_end; wc++)
|
||||
wc = wc_start;
|
||||
for (;;) {
|
||||
utf8_insert_width_cache(wc, width);
|
||||
if (wc == wc_end)
|
||||
break;
|
||||
wc++;
|
||||
}
|
||||
} else {
|
||||
utf8_no_width = 1;
|
||||
ud = utf8_fromcstr(copy);
|
||||
|
||||
Reference in New Issue
Block a user