mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
term: fix crash in header
when divider.len < 2 (#5956)
This commit is contained in:
parent
b537d8e23e
commit
b7bdb97f7d
1 changed files with 1 additions and 1 deletions
|
@ -49,7 +49,7 @@ pub fn h_divider(divider string) string {
|
||||||
// e.g: term.header('TEXT', '=')
|
// e.g: term.header('TEXT', '=')
|
||||||
// =============== TEXT ===============
|
// =============== TEXT ===============
|
||||||
pub fn header(text, divider string) string {
|
pub fn header(text, divider string) string {
|
||||||
if text.len == 0 {
|
if text.len == 0 || divider.len < 2 {
|
||||||
return h_divider(divider)
|
return h_divider(divider)
|
||||||
}
|
}
|
||||||
cols,_ := get_terminal_size()
|
cols,_ := get_terminal_size()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue