mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
m_cap: ensure buffers are initialized properly
This commit is contained in:
parent
802710b59a
commit
6b23b98ab6
1 changed files with 4 additions and 2 deletions
|
@ -146,8 +146,8 @@ clicap_find(const char *data, int *negate, int *finished)
|
||||||
static void
|
static void
|
||||||
clicap_generate(struct Client *source_p, const char *subcmd, int flags, int clear)
|
clicap_generate(struct Client *source_p, const char *subcmd, int flags, int clear)
|
||||||
{
|
{
|
||||||
char buf[BUFSIZE];
|
char buf[BUFSIZE] = { 0 };
|
||||||
char capbuf[BUFSIZE];
|
char capbuf[BUFSIZE] = { 0 };
|
||||||
char *p;
|
char *p;
|
||||||
int buflen = 0;
|
int buflen = 0;
|
||||||
int curlen, mlen;
|
int curlen, mlen;
|
||||||
|
@ -206,8 +206,10 @@ clicap_generate(struct Client *source_p, const char *subcmd, int flags, int clea
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
sendto_one(source_p, "%s * :%s", buf, capbuf);
|
sendto_one(source_p, "%s * :%s", buf, capbuf);
|
||||||
|
|
||||||
p = capbuf;
|
p = capbuf;
|
||||||
buflen = mlen;
|
buflen = mlen;
|
||||||
|
memset(capbuf, 0, sizeof capbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(clear)
|
if(clear)
|
||||||
|
|
Loading…
Reference in a new issue