Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/rogue Fix for FreeBSD/13278, from FreeBSD:



details:   https://anonhg.NetBSD.org/src/rev/2aeea7072b66
branches:  trunk
changeset: 513716:2aeea7072b66
user:      wiz <wiz%NetBSD.org@localhost>
date:      Thu Aug 09 13:02:49 2001 +0000

description:
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:

 games/rogue/score.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 21ac65f2519b -r 2aeea7072b66 games/rogue/score.c
--- a/games/rogue/score.c       Thu Aug 09 11:54:32 2001 +0000
+++ b/games/rogue/score.c       Thu Aug 09 13:02:49 2001 +0000
@@ -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 @@
                        (void) strcat(buf, "a total winner");
                        break;
                case KFIRE:
-                       (void) strcpy(buf, "killed by fire");
+                       (void) strcat(buf, "killed by fire");
                        break;
                }
        } else {



Home | Main Index | Thread Index | Old Index