diff options
author | epochqwert <epoch@53flpnlls43fcguy.onion> | 2015-03-08 07:18:38 -0500 |
---|---|---|
committer | epochqwert <epoch@53flpnlls43fcguy.onion> | 2015-03-08 07:18:38 -0500 |
commit | ecb12efc5ce737532402167679c0f7ffb22c495b (patch) | |
tree | 529580999c00d45a66cf367e7c2b8d8f45f7614d /libirc/examples/link.c | |
parent | ca97dc3913735ac0aed03974ada43aede82bec02 (diff) | |
download | segfault-ecb12efc5ce737532402167679c0f7ffb22c495b.tar.gz segfault-ecb12efc5ce737532402167679c0f7ffb22c495b.zip |
fixed support of optional : before channel name when parsing JOIN messages from server.
Diffstat (limited to 'libirc/examples/link.c')
-rw-r--r-- | libirc/examples/link.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libirc/examples/link.c b/libirc/examples/link.c index 5c13e94..0c9e7dd 100644 --- a/libirc/examples/link.c +++ b/libirc/examples/link.c @@ -91,7 +91,7 @@ void line_handler(int fd,char *line) {//this should be built into the libary? } if(s && user->nick && t) { if(!strcmp(s,"JOIN")) { - snprintf(tmp,sizeof(tmp)-1,"%cACTION %s has joined %s%c",1,user->nick,t+1,1); + snprintf(tmp,sizeof(tmp)-1,"%cACTION %s has joined %s%c",1,user->nick,t+(*t==':'),1); privmsg_others(fd,tmp); //send a join message to the other end. } @@ -116,7 +116,7 @@ int main(int argc,char *argv[]) { printf("%d server: %s port: %s channel: %s\n",i,argv[(i*3)+1],argv[(i*3)+2],argv[(i*3)+3]); fds[i]=serverConnect(argv[(i*3)+1],argv[(i*3)+2]); chans[i]=strdup(argv[(i*3)+3]); - mywrite(fds[i],"NICK link\r\nUSER a b c :d\r\n"); + mywrite(fds[i],"NICK link8239\r\nUSER a b c :d\r\n"); } fds[i]=-1; //heh. you can write your own code for picking a different nick per server. fuck you. |