From 635fcead0a5a3283a3501dbc1e7288c440870783 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 16 Nov 2006 20:01:26 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@693 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/client.cpp | 4 ++-- source/src/clients2c.cpp | 4 ++-- source/src/cube.h | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source/src/client.cpp b/source/src/client.cpp index 00f9f8d0..754f54ba 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -63,7 +63,7 @@ void newname(char *name) if(name[0]) { c2sinit = false; - s_strncpy(player1->name, name, 16); + s_strncpy(player1->name, name, MAXNAMELEN+1); } else conoutf("your name is: %s", player1->name); }; @@ -73,7 +73,7 @@ void newteam(char *name) if(name[0]) { if(m_teammode) ctf_team(name); - else { c2sinit = false; s_strncpy(player1->team, name, 5); }; + else { c2sinit = false; s_strncpy(player1->team, name, MAXTEAMLEN+1); }; } else conoutf("your team is: %s", player1->team); }; diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 9f34f308..1191b629 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -173,9 +173,9 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) BotManager.LetBotsUpdateStats(); // End add by Rick }; - s_strcpy(d->name, text); + s_strncpy(d->name, text, MAXNAMELEN+1); getstring(text, p); - s_strcpy(d->team, text); + s_strncpy(d->team, text, MAXTEAMLEN+1); d->skin = getint(p); d->lifesequence = getint(p); c2si = true; diff --git a/source/src/cube.h b/source/src/cube.h index ea4bb133..828db238 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -355,6 +355,9 @@ struct dynent : physent // animated ent dynent() { reset(); loopi(2) { lastanimswitchtime[i] = -1; lastmodel[i] = NULL; }; }; }; +#define MAXNAMELEN 15 +#define MAXTEAMLEN 4 + struct bounceent; struct playerent : dynent