Skip to content

Commit

Permalink
Fix case sensitivity in IRC commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
Subsentient committed Mar 4, 2015
1 parent 480eb05 commit 2bc98ed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/irc.c
Expand Up @@ -147,7 +147,14 @@ bool IRC_GetStatusCode(const char *Message, int *OutNumber)

enum IRCMessageType IRC_GetMessageType(const char *InStream_)
{ //Another function torn out of aqu4bot.
const char *InStream = InStream_;
char InStreamA[256];

//We need lower case for this comparison.
strncpy(InStreamA, InStream_, sizeof InStreamA - 1);
InStreamA[sizeof InStreamA - 1] = '\0';
for (int TInc = 0; (InStreamA[TInc] = tolower(InStreamA[TInc])); ++TInc); //Lower case it

const char *InStream = InStreamA;
char Command[32];
unsigned Inc = 0;

Expand Down

0 comments on commit 2bc98ed

Please sign in to comment.