summaryrefslogtreecommitdiffstats
path: root/phantasia
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-05-26 00:30:16 +0000
committerdholland <dholland@NetBSD.org>2009-05-26 00:30:16 +0000
commitae29a96c5994a7d98108cec38ab0547bd45690b2 (patch)
tree5adcb20001526a493e2c0fcb2865ffa73f83a54c /phantasia
parent8053a125d99718a8c77d9ce35bc4d0c80119ec8f (diff)
downloadbsdgames-darwin-ae29a96c5994a7d98108cec38ab0547bd45690b2.tar.gz
bsdgames-darwin-ae29a96c5994a7d98108cec38ab0547bd45690b2.tar.zst
bsdgames-darwin-ae29a96c5994a7d98108cec38ab0547bd45690b2.zip
Paranoia about lengths of login names. From pjanzen of OpenBSD.
Diffstat (limited to 'phantasia')
-rw-r--r--phantasia/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/phantasia/main.c b/phantasia/main.c
index 3a0f919c..57fe7557 100644
--- a/phantasia/main.c
+++ b/phantasia/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.20 2009/05/26 00:27:23 dholland Exp $ */
+/* $NetBSD: main.c,v 1.21 2009/05/26 00:30:16 dholland Exp $ */
/*
* Phantasia 3.3.2 -- Interterminal fantasy game
@@ -162,7 +162,7 @@ main(int argc, char **argv)
Timeout = TRUE;
/* update some important player statistics */
- strcpy(Player.p_login, Login);
+ strlcpy(Player.p_login, Login, sizeof(Player.p_login));
time(&seconds);
Player.p_lastused = localtime(&seconds)->tm_yday;
Player.p_status = S_PLAYING;