]> arthur.barton.de Git - ngircd.git/commitdiff
Fix gcc warning, initialize "list" variable to NULL
authorAlexander Barton <alex@barton.de>
Mon, 12 Mar 2012 21:27:55 +0000 (22:27 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 12 Mar 2012 21:27:55 +0000 (22:27 +0100)
This fixes the following warning with gcc 4.6.3.:

  irc-mode.c: In function "Channel_Mode":
  irc-mode.c:947:26: error: "list" may be used uninitialized
                     in this function
  irc-mode.c:884:25: error: "list" may be used uninitialized
                     in this function

(The variable has never been used uninitialized, so don't worry)

src/ngircd/irc-mode.c

index 80b2949038b7cce6084537f771d21dd398f095a7..fa35cdd0f29d7742d92c169f6ce992a56eaa1ca5 100644 (file)
@@ -856,7 +856,7 @@ Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
            const char *Pattern)
 {
        const char *mask;
-       struct list_head *list;
+       struct list_head *list = NULL;
        long int current_count;
 
        assert(Client != NULL);
@@ -923,7 +923,7 @@ Del_From_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
              const char *Pattern)
 {
        const char *mask;
-       struct list_head *list;
+       struct list_head *list = NULL;
 
        assert(Client != NULL);
        assert(Channel != NULL);