Bug 13278

Summary: rogue: killed by fire corrupts score file
Product: Base System Reporter: krentel <krentel>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
file.diff none

Description krentel 1999-08-21 03:10:00 UTC
I'm embarrassed to be sending a PR on rogue, but I have a fix and it's
an excuse to bug you about a couple other things.

When a game ends that makes the top 10, the function insert_score in
score.c is called to make the new score file.  But the case for KFIRE
(killed by fire) incorrectly uses strcpy instead of strcat (all the
other cases use strcat).  This puts the string in the wrong place and
corrupts the score file.

Also, I've never really liked the fact that a make world resets the
score file to empty (the beforeinstall target in Makefile).  I just
delete the beforeinstall target, but probably a better solution is to
test if the score file exists and install a new one only if it doesn't.

Finally, would it be possible to MFC all the fixes from NetBSD back in
April 99 (PR 8083) into 3.x?

Fix: For the killed by fire problem:

% diff -u score.c.orig score.c
--------------------------------

To avoid make world clobbering the score file:

% diff -u Makefile.orig Makefile
How-To-Repeat: Go down to level 21+, stand on a scroll of scare monster and let a 
Dragon flame you to death.  But first save a copy of the score file.
Comment 1 tim 1999-08-22 04:45:47 UTC
>
>To avoid make world clobbering the score file:
>
>% diff -u Makefile.orig Makefile
>--- Makefile.orig       Thu Aug 19 19:46:01 1999

Originator notes that bin/13068 contains a more comprehensive fix for
this latter problem (but _not_ the former).
Comment 2 Poul-Henning Kamp freebsd_committer freebsd_triage 2001-05-23 22:01:05 UTC
State Changed
From-To: open->closed

Committed (with some delay), Thanks!