Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //check for PRIVMSG
- char *privmsg = strstr(buffer, "PRIVMSG ");
- if (privmsg != 0) //found!
- {
- char *chr, old, nick[512], msg[4096];
- memset(nick, 0, 512);
- chr = strchr(buffer, '!');
- if ((chr - buffer) > 32)
- chr = strchr(buffer, ' ');
- old = *chr; *chr = 0;
- strcpy(nick, buffer + 1);
- *chr = old;
- memset(msg, 0, 4096);
- chr = strchr(privmsg, ':');
- strcpy(msg, chr + 1);
- chr = strchr(msg, '\r');
- if (chr != 0) *chr = 0;
- printf("\n================\n%s: %s\n================\n",
- nick, msg);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement