summaryrefslogtreecommitdiff
path: root/games/phantasia/gamesupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'games/phantasia/gamesupport.c')
-rw-r--r--games/phantasia/gamesupport.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/games/phantasia/gamesupport.c b/games/phantasia/gamesupport.c
index 2c9eaf6d098..0ab75d617ed 100644
--- a/games/phantasia/gamesupport.c
+++ b/games/phantasia/gamesupport.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gamesupport.c,v 1.4 2000/06/29 07:39:43 pjanzen Exp $ */
+/* $OpenBSD: gamesupport.c,v 1.5 2003/04/06 18:50:38 deraadt Exp $ */
/* $NetBSD: gamesupport.c,v 1.3 1995/04/24 12:24:28 cgd Exp $ */
/*
@@ -231,7 +231,8 @@ changestats(ingameflag)
truncstring(Databuf);
if (Databuf[0] != '\0')
if (Wizard || findname(Databuf, &Other) < 0L)
- strcpy(playerp->p_name, Databuf);
+ strlcpy(playerp->p_name, Databuf,
+ sizeof playerp->p_name);
} else
/* get new password */
{
@@ -705,10 +706,13 @@ enterscore()
if ((!found) || Player.p_level > sbuf.sb_level)
/* put new entry in for this login */
{
- strcpy(sbuf.sb_login, Player.p_login);
- strcpy(sbuf.sb_name, Player.p_name);
+ strlcpy(sbuf.sb_login, Player.p_login,
+ sizeof sbuf.sb_login);
+ strlcpy(sbuf.sb_name, Player.p_name,
+ sizeof sbuf.sb_name);
sbuf.sb_level = Player.p_level;
- strcpy(sbuf.sb_type, descrtype(&Player, TRUE));
+ strlcpy(sbuf.sb_type, descrtype(&Player, TRUE),
+ sizeof sbuf.sb_type);
}
/* update entry */
fseek(fp, loc, SEEK_SET);