- scan.c:scan_irckline(): sanitize array initalization
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Fri, 17 Jul 2015 11:37:06 +0000 (11:37 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Fri, 17 Jul 2015 11:37:06 +0000 (11:37 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@6287 82007160-df01-0410-b94d-b575c5fd34c7

src/scan.c

index 4553c76b00c1dc8894b3165f154e966761e41d8a..dcdf7ad60297db5268386c983815c46301f9548f 100644 (file)
@@ -755,20 +755,14 @@ scan_irckline(const struct scan_struct *ss, const char *format, const char *type
     const char *data;
   } table[] =
   {
-    { 'i',  NULL },
-    { 'h',  NULL },
-    { 'u',  NULL },
-    { 'n',  NULL },
-    { 't',  NULL },
-    { '\0', NULL }
+    { 'i',  ss->ip           },
+    { 'h',  ss->irc_hostname },
+    { 'u',  ss->irc_username },
+    { 'n',  ss->irc_nick     },
+    { 't',  type             },
+    { '\0', NULL             }
   };
 
-  table[0].data = ss->ip;
-  table[1].data = ss->irc_hostname;
-  table[2].data = ss->irc_username;
-  table[3].data = ss->irc_nick;
-  table[4].data = type;
-
   /*
    * Copy format to message character by character, inserting any matching
    * data after %.