diff --git a/botthread.c b/botthread.c index b5cbebc..f896ed0 100644 --- a/botthread.c +++ b/botthread.c @@ -314,7 +314,7 @@ writeLog(0,"[%s][%s]\n",output,channel); tuveSendAllInChan(channel,0x0,output); - sprintf(output,"MSG:TUveD:%s:Playing %s (%d:%.2d",channel,tmpChan->videoChanTitle,min,sec); + sprintf(output,"MSG:TUveD:%s:Playing %s (%d:%.2d)",channel,tmpChan->videoChanTitle,min,sec); tuveSendAllInChan(channel,0x0,output); if (tmpChan->count != -1) { @@ -349,9 +349,9 @@ if (tmpChans->modes[CHAN_QUEUE] == 0x0) /* If Channel Has Queues Disabled Jump Right To Random */ goto getRandom; - if (tmpChans->count != MAX_COUNT) { + if (tmpChans->count == MAX_COUNT) { lC = 0; - while (lC < 2) { + while (lC <= tmpChans->userCount) { /* Reset Chan Counter */ tmpChans->count = 0x0; @@ -370,9 +370,9 @@ lC++; } } - else { - goto gotUser; - } + else if (tmpChans->nextUser != 0x0) + goto gotUser; + /* Find A Random Song */ getRandom: if (tmpChans->modes[CHAN_RANDOM] == 0x1) { diff --git a/nick.c b/nick.c index bae2ac0..1452ebc 100644 --- a/nick.c +++ b/nick.c @@ -45,6 +45,7 @@ tuveUserChans_t *chans = 0x0; char output[256]; char channel[MAX_CHAN_LEN + 1]; + int len = 0; if (strlen(nick) > MAX_USER_LEN) return(0x0); @@ -59,7 +60,8 @@ sprintf(output,"MSG:TUveD:STATUS:%s is %s",user->userInfo.username,user->host); sSendData(userConnection,output); - sprintf(output,"MSG:TUveD:STATUS:%s Signed On %s",user->userInfo.username,ctime(&user->signedOn)); + len = sprintf(output,"MSG:TUveD:STATUS:%s Signed On %s",user->userInfo.username,ctime(&user->signedOn)); + output[len -1] = '\0'; sSendData(userConnection,output); if (user->userInfo.modes[USER_OVERLORD] == 1) {