diff options
author | epochqwert <epoch@hacking.allowed.org> | 2016-05-29 06:09:47 +0000 |
---|---|---|
committer | epochqwert <epoch@hacking.allowed.org> | 2016-05-29 06:09:47 +0000 |
commit | 7ca650030f3f122a26084b92398b52744b3d0dfd (patch) | |
tree | 880574804e41267b904ff691a6c7354496d188ad | |
parent | 9b3a9a82c4ec8e95d3c7ea4e7485820b07ef6b6e (diff) | |
download | libirc-7ca650030f3f122a26084b92398b52744b3d0dfd.tar.gz libirc-7ca650030f3f122a26084b92398b52744b3d0dfd.zip |
nick is now set by environment variable NICK
-rw-r--r-- | examples/link.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/link.c b/examples/link.c index 2e4b933..dc2ffab 100644 --- a/examples/link.c +++ b/examples/link.c @@ -93,13 +93,15 @@ int main(int argc,char *argv[]) { fds=malloc(sizeof(int) * (argc+3) / 3); chans=malloc(sizeof(char *) * (argc+3) / 3); int i=0; + char tmp[512]; printf("%d\n",argc); for(i=0;((i*3)+3)<argc;i++) { 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]); if(fds[i] == -1) return 1; chans[i]=strdup(argv[(i*3)+3]); - mywrite(fds[i],"NICK link8239\r\nUSER a b c :d\r\n"); + snprintf(tmp,sizeof(tmp)-1,"NICK %s\r\nUSER a b c :d\r\n",getenv("NICK")); + write(fds[i],tmp,strlen(tmp)); } fds[i]=-1; //heh. you can write your own code for picking a different nick per server. fuck you. |