feat(ui,db,cmd): reduce dublicate code in window subwin logic, unify SQLite helpers, NULL checks added
Some checks failed
CI Code / Check spelling (pull_request) Successful in 18s
CI Code / Linux (arch) (pull_request) Failing after 22s
CI Code / Check coding style (pull_request) Failing after 31s
CI Code / Linux (debian) (pull_request) Successful in 15m14s
CI Code / Linux (ubuntu) (pull_request) Successful in 15m36s

window.c: add _get_subwin_cols, _apply_split_resize, _check_subwin_width; refactor show/hide/resize/refresh/update
database.c: add _db_prepare_ctx, _db_teardown; safer init/queries with fallback timestamp
cmd_defs.c: guard fopen in docgen; inputwin.c: replace assert with runtime check
This commit is contained in:
2025-11-10 15:09:09 +03:00
parent 332cd243c6
commit 5f01f8f546
4 changed files with 83 additions and 52 deletions

View File

@@ -144,10 +144,13 @@ void
create_input_window(void)
{
/* MB_CUR_MAX is evaluated at runtime depending on the current
* locale, therefore we check that our own version is big enough
* and bail out if it isn't.
* locale; ensure our own compiled-in maximum is sufficient.
* Fail gracefully instead of aborting in production.
*/
assert(MB_CUR_MAX <= PROF_MB_CUR_MAX);
if (MB_CUR_MAX > PROF_MB_CUR_MAX) {
cons_show_error("Your locale's MB_CUR_MAX (%zu) exceeds PROF_MB_CUR_MAX (%d); input window disabled.", (size_t)MB_CUR_MAX, PROF_MB_CUR_MAX);
return;
}
#ifdef NCURSES_REENTRANT
set_escdelay(25);
#else