Skip to content

Commit 35cab62

Browse files
authored
update parser() function to zero arrays
1 parent bf12191 commit 35cab62

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kirc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,9 @@ static void
145145
parser(char *in) {
146146

147147
int len;
148-
char ltr[200], cha[IRC_CHAN_MAX], nic[200], hos[200], \
149-
usr[200], cmd[200], msg[200], pre[200];
148+
char ltr[200], cha[IRC_CHAN_MAX] = {0}, nic[200] = {0}, hos[200], \
149+
usr[200] = {0}, cmd[200] = {0}, msg[200] = {0}, pre[200] = {0};
150150

151-
cmd[0] = msg[0] = pre[0] = '\0';
152151
if (verb) printf(">> %s\n", in);
153152
if (!strncmp(in, "PING", 4)) {
154153
in[1] = 'O';

0 commit comments

Comments
 (0)