whowas.c: Apply patch from tau replacing sprintf() with snprintf().

git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@441 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2013-11-11 13:37:14 +00:00
parent f222b94d13
commit 220225f4ff

View File

@@ -237,13 +237,14 @@ WhowasList *tmp;
/* Used to rehash whowas listings for new shitlist entries */
void sync_whowas_addshit(ShitList *added)
{
WhowasList *tmp;
char user[BIG_BUFFER_SIZE];
WhowasList *tmp;
char user[BIG_BUFFER_SIZE];
for (tmp = next_userhost(&whowas_userlist_list, NULL); tmp; tmp = next_userhost(&whowas_userlist_list, tmp))
{
if (check_channel_match(added->channels, tmp->channel))
{
sprintf(user, "%s!%s", tmp->nicklist->nick, tmp->nicklist->host);
snprintf(user, sizeof user, "%s!%s", tmp->nicklist->nick, tmp->nicklist->host);
if (wild_match(added->filter, user))
tmp->nicklist->shitlist = added;
}
@@ -252,7 +253,7 @@ char user[BIG_BUFFER_SIZE];
{
if (check_channel_match(added->channels, tmp->channel))
{
sprintf(user, "%s!%s", tmp->nicklist->nick, tmp->nicklist->host);
snprintf(user, sizeof user, "%s!%s", tmp->nicklist->nick, tmp->nicklist->host);
if (wild_match(added->filter, user))
tmp->nicklist->shitlist = added;
}