src/parse.c
changeset 38 c2f62d1b8d76
parent 33 56571d34d754
child 39 0ae006af497e
--- a/src/parse.c
+++ b/src/parse.c
@@ -24,7 +24,7 @@
 #define SOURCE_URL "http://largo.homelinux.org/cgi-bin/gitweb.cgi?p=net/mcbot.git"
 #endif
 
-enum {
+enum command_map {
     HELP, JOIN, LEAVE, ADD, REPLACE, DELETE, LIST, SEARCH, INFO, PING, ON, OFF, DEBUG,
     VACCUUM, LOGOUT, WHO, WHOIS, TIME, TELL, OP, DEOP, KICK, BAN, UNBAN, KICKBAN, HELLO
 };
@@ -70,7 +70,7 @@
 {
     static char msg[DEFAULT_BUF_SIZE];
     int cmd = -1;
-    int i;
+    enum command_map map;
     char *token;
     char *parameters;
 
@@ -95,11 +95,11 @@
         return NULL;
     }
 
-    i = 0;
+    map = 0;
     token = strtok (message->line, " ");
-    while (Bot_Commands[i]) {
-        if (!strcmp (token, Bot_Commands[i])) {
-            switch (i) {
+    while (Bot_Commands[map]) {
+        if (!strcmp (token, Bot_Commands[map])) {
+            switch (map) {
             case HELP:
                 if ((token = strtok (NULL, "\r\n")))
                     cmd = atoi (token);
@@ -313,7 +313,7 @@
                 return msg;
             }
         }
-        i++;
+        map++;
     }
 
     return NULL;