Qt tombstone bugs

Infrastructure bits:  Qt tombstone uses a short buffer; make sure that
the plname value fits instead of relying on snprintf() to truncate it.
A warning about gold, if any, was iffy but this should guarantee no
reason for future complaint.  Year was safe but a compiler sensitive
to buffer overflows wouldn't know that.

Actual bugs:  Qt used money in inventory for gold amount on tombstone;
that overlooks gold in containers and will be 0 by tombstone stage if
bones get saved.  Year was recalculated from current date+time instead
of using the value that gets passed in--blindly flagging that variable
as UNUSED was a mistake.
This commit is contained in:
PatR
2020-08-20 16:56:50 -07:00
parent 61b86b8838
commit c062822a7c
6 changed files with 85 additions and 49 deletions
+4 -3
View File
@@ -898,12 +898,13 @@ curses_end_screen()
/*
outrip(winid, int)
-- The tombstone code. If you want the traditional code use
genl_outrip for the value and check the #if in rip.c.
-- The tombstone code. We use genl_outrip() from rip.c
instead of rolling our own.
*/
void
curses_outrip(winid wid UNUSED,
int how UNUSED)
int how UNUSED,
time_t when UNUSED)
{
return;
}