1
0
forked from bip/bip

Realloc correct size when receiving admin privmsg.

This commit is contained in:
Arnaud Cornet 2008-01-06 00:25:56 +01:00
parent c5d1f537e4
commit 20129da225

View File

@ -2019,7 +2019,7 @@ int adm_bip(bip_t *bip, struct link_client *ic, struct line *line,
continue; continue;
} }
line->elemv = realloc(line->elemv, line->elemv = realloc(line->elemv,
line->elemc * sizeof(char *)); (line->elemc + 1) * sizeof(char *));
line->elemv[line->elemc] = malloc(slen + 1); line->elemv[line->elemc] = malloc(slen + 1);
memcpy(line->elemv[line->elemc], ptr, slen); memcpy(line->elemv[line->elemc], ptr, slen);
line->elemv[line->elemc][slen] = 0; line->elemv[line->elemc][slen] = 0;