Fix ncurses compatibility: remove internal structure access

- Remove direct access to curscr->_cury and curscr->_curx
- Replace with public API call move() for cursor positioning
- Fixes critical build failure on modern systems with ncurses 6.x
- Build now succeeds on macOS arm64

See MODERNIZATION_LOG.md for detailed reasoning and impact analysis.
This commit is contained in:
David Silva
2025-11-07 15:30:46 +00:00
parent e13f5c948a
commit b66c6659c9
3 changed files with 151 additions and 7 deletions

11
main.c
View File

@@ -66,9 +66,9 @@ main(int argc, char **argv, char **envp)
open_score();
/*
* Drop setuid/setgid after opening the scoreboard file.
*/
/*
* Drop setuid/setgid after opening the scoreboard file.
*/
md_normaluser();
@@ -192,7 +192,7 @@ rnd(int range)
* roll:
* Roll a number of dice
*/
int
int
roll(int number, int sides)
{
int dtotal = 0;
@@ -237,9 +237,8 @@ tstp(int ignored)
wrefresh(curscr);
getyx(curscr, y, x);
mvcur(y, x, oy, ox);
move(oy, ox); /* Use public API instead of internal structure access */
fflush(stdout);
curscr->_cury = oy;
curscr->_curx = ox;
}
/*