Fix two mistakes in r5176 (static string cleanup) that made us copy far

less from two strings than we should.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5233 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2008-06-08 13:30:05 +00:00
parent 504ffcc625
commit a05859644a
1 changed files with 2 additions and 2 deletions

View File

@ -406,7 +406,7 @@ static void NETsendGAMESTRUCT(TCPsocket socket, const GAMESTRUCT* game)
// Now dump the data into the buffer
// Copy a string
sstrcpy(buffer, game->name);
strlcpy(buffer, game->name, sizeof(game->name));
buffer += sizeof(game->name);
// Copy 32bit large big endian numbers
@ -416,7 +416,7 @@ static void NETsendGAMESTRUCT(TCPsocket socket, const GAMESTRUCT* game)
buffer += sizeof(int32_t);
// Copy yet another string
sstrcpy(buffer, game->desc.host);
strlcpy(buffer, game->desc.host, sizeof(game->desc.host));
buffer += sizeof(game->desc.host);
// Copy 32bit large big endian numbers