fixed ChanNode "fast access" array
authorpk910 <philipp@zoelle1.de>
Wed, 10 Aug 2011 02:22:00 +0000 (04:22 +0200)
committerpk910 <philipp@zoelle1.de>
Wed, 10 Aug 2011 02:22:00 +0000 (04:22 +0200)
ChanNode.c

index f7161aacee15632374be936bbfda69ffe211e32f..e4e59de01cb8ed2402d19d0f20bcac1b3d7b29f5 100644 (file)
@@ -12,7 +12,7 @@ void init_ChanNode() {
      ---------------------------
      = 47
     */
-    userList = calloc(47, sizeof(*userList));
+    chanList = calloc(47, sizeof(*chanList));
 }
 
 int is_valid_chan(const char *name) {
@@ -53,7 +53,7 @@ static int get_chanlist_entry(int name) {
 }
 
 struct ChanNode* getChanByName(const char *name) { //case insensitive
-    int chanListIndex = get_chanlist_entry(*name);
+    int chanListIndex = get_chanlist_entry(name[1]);
     if(chanListIndex == -1 || chanList[chanListIndex] == NULL)
         return NULL;
     struct ChanNode *chan;