diff --git a/main.c b/main.c index 3e6f914..c6518c8 100644 --- a/main.c +++ b/main.c @@ -80,10 +80,6 @@ writeLog(3,"readSocks: [%i]\n",readSocks); - rc = pthread_mutex_lock(&chanMutex); - printf("MAIN LOCK: [%i]\n",rc); - - if (readSocks < 0) { perror("select failed"); exit(0x1); diff --git a/tuve.c b/tuve.c index be1b94c..92ae832 100644 --- a/tuve.c +++ b/tuve.c @@ -113,11 +113,14 @@ if (data != 0x0) { chan = strtok_r(data,":",&tok_last); msg = strtok_r(NULL,"\n",&tok_last); - if (msg[0] == '.' && msg[1] == 't' && msg[2] == 'v') - tuveBotCMD(userConnection,chan,msg+3); - else - sprintf(output,"CHANMSG:%s:%s:%s\n",userConnection->userInfo.username,chan,msg); - tuveSendAllInChan(chan,userConnection,output); + if ((msg != 0x0) && (strlen(msg) > 3)) { + if (msg[0] == '.' && msg[1] == 't' && msg[2] == 'v') + tuveBotCMD(userConnection,chan,msg+3); + else { + sprintf(output,"CHANMSG:%s:%s:%s\n",userConnection->userInfo.username,chan,msg); + tuveSendAllInChan(chan,userConnection,output); + } + } } } else if (strcasecmp(cmd,"topic") == 0x0) {