fix(ui): address PR review comments
All checks were successful
CI Code / Check spelling (pull_request) Successful in 20s
CI Code / Check coding style (pull_request) Successful in 38s
CI Code / Code Coverage (pull_request) Successful in 4m48s
CI Code / Linux (debian) (pull_request) Successful in 6m8s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m13s
CI Code / Linux (arch) (pull_request) Successful in 6m21s
All checks were successful
CI Code / Check spelling (pull_request) Successful in 20s
CI Code / Check coding style (pull_request) Successful in 38s
CI Code / Code Coverage (pull_request) Successful in 4m48s
CI Code / Linux (debian) (pull_request) Successful in 6m8s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m13s
CI Code / Linux (arch) (pull_request) Successful in 6m21s
- inputwin.c: improve MB_CUR_MAX error message with actionable advice - inputwin.c: add log_error when input window pad allocation fails - statusbar.c: add log_warning for invalid cols values - window.c: simplify _check_subwin_width using CLAMP macro
This commit is contained in:
@@ -79,15 +79,7 @@ static void _win_print_wrapped(WINDOW* win, const char* const message, size_t in
|
||||
static int
|
||||
_check_subwin_width(int cols, int width)
|
||||
{
|
||||
if (cols > 1) {
|
||||
if (width < 1)
|
||||
width = 1;
|
||||
if (width >= cols)
|
||||
width = cols - 1;
|
||||
} else {
|
||||
width = 1;
|
||||
}
|
||||
return width;
|
||||
return cols <= 1 ? 1 : CLAMP(width, 1, cols - 1);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user