Fix uninitialized mod_chanmode element in debug build
authorMichael Poole <mdpoole@troilus.org>
Tue, 30 Mar 2004 04:25:14 +0000 (04:25 +0000)
committerMichael Poole <mdpoole@troilus.org>
Tue, 30 Mar 2004 04:25:14 +0000 (04:25 +0000)
* Convert an old-style auto-variable mod_chanmode to use
mod_chanmode_init() so that all fields are initialized.
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-38

src/proto-common.c

index 3fcadd7b5c0b3f2fcd13ec3b26897e8f2e46f879..5a7a689ca2c5f639684b02c0c9aa9d9ba23523a4 100644 (file)
@@ -635,8 +635,8 @@ mod_chanmode(struct userNode *who, struct chanNode *channel, char **modes, unsig
 int
 irc_make_chanmode(struct chanNode *chan, char *out) {
     struct mod_chanmode change;
+    mod_chanmode_init(&change);
     change.modes_set = chan->modes;
-    change.modes_clear = change.argc = 0;
     change.new_limit = chan->limit;
     safestrncpy(change.new_key, chan->key, sizeof(change.new_key));
     return strlen(mod_chanmode_format(&change, out));