mirror of
https://github.com/libretro/libretro-tyrquake.git
synced 2024-11-24 08:29:42 +00:00
client: tidy up snprintf handling in CL_ProcessUserInfo
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
parent
0ebd2471f1
commit
5ca9e3f44c
@ -951,8 +951,14 @@ CL_ProcessUserinfo
|
||||
static void
|
||||
CL_ProcessUserInfo(int slot, player_info_t * player)
|
||||
{
|
||||
strncpy(player->name, Info_ValueForKey(player->userinfo, "name"),
|
||||
sizeof(player->name) - 1);
|
||||
int len;
|
||||
char *name;
|
||||
|
||||
name = Info_ValueForKey(player->userinfo, "name");
|
||||
len = snprintf(player->name, sizeof(player->name), "%s", name);
|
||||
if (len > sizeof(player->name) - 1)
|
||||
player->name[sizeof(player->name) - 1] = 0;
|
||||
|
||||
player->topcolor = atoi(Info_ValueForKey(player->userinfo, "topcolor"));
|
||||
player->bottomcolor =
|
||||
atoi(Info_ValueForKey(player->userinfo, "bottomcolor"));
|
||||
|
Loading…
Reference in New Issue
Block a user