summaryrefslogtreecommitdiffstats
path: root/rogue/score.c
diff options
context:
space:
mode:
authorwiz <wiz@NetBSD.org>2001-08-09 13:02:49 +0000
committerwiz <wiz@NetBSD.org>2001-08-09 13:02:49 +0000
commitaae29e8220b94c604b20f29004fadddc7d6e2ad5 (patch)
treee71590a1883fc0e9b0a077aa8d8767e72484f823 /rogue/score.c
parent93dcff7ea2970754f655050226630589869b3b6d (diff)
downloadbsdgames-darwin-aae29e8220b94c604b20f29004fadddc7d6e2ad5.tar.gz
bsdgames-darwin-aae29e8220b94c604b20f29004fadddc7d6e2ad5.tar.zst
bsdgames-darwin-aae29e8220b94c604b20f29004fadddc7d6e2ad5.zip
Fix for FreeBSD/13278, from FreeBSD:
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.
Diffstat (limited to 'rogue/score.c')
-rw-r--r--rogue/score.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rogue/score.c b/rogue/score.c
index 3ef52dcd..e0f64592 100644
--- a/rogue/score.c
+++ b/rogue/score.c
@@ -1,4 +1,4 @@
-/* $NetBSD: score.c,v 1.8 1999/09/12 09:02:23 jsm Exp $ */
+/* $NetBSD: score.c,v 1.9 2001/08/09 13:02:49 wiz Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: score.c,v 1.8 1999/09/12 09:02:23 jsm Exp $");
+__RCSID("$NetBSD: score.c,v 1.9 2001/08/09 13:02:49 wiz Exp $");
#endif
#endif /* not lint */
@@ -369,7 +369,7 @@ insert_score(scores, n_names, n_name, rank, n, monster, other)
(void) strcat(buf, "a total winner");
break;
case KFIRE:
- (void) strcpy(buf, "killed by fire");
+ (void) strcat(buf, "killed by fire");
break;
}
} else {