From 9429905cb75e36107df9c0b44a3dd9293520f4f2 Mon Sep 17 00:00:00 2001 From: epochqwert Date: Thu, 12 Mar 2015 22:55:04 -0500 Subject: an upgrade to link.c to allow keys in channels. segfault fixed to set tailf[i].to=0 in more cases so it can be tested. don't remember what changes were made to libirc.c --- segfault.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'segfault.c') diff --git a/segfault.c b/segfault.c index 8013e0b..a371eb1 100644 --- a/segfault.c +++ b/segfault.c @@ -360,7 +360,8 @@ void file_tail(int fd,char *from,char *file,char *args,int opt,struct user *user privmsg(fd,"#cmd",tmp); } fstat(fdd,&st); // <-- is this needed? - /*for(j=0;j_> weird. + tailf[i].to=0; + } tailf[i].to=strdup(from);//if this properly free()d before being assigned to? if(!tailf[i].to) { mywrite(fd,"QUIT :malloc error 3!!!\r\n"); @@ -494,6 +500,7 @@ void c_changetail(int fd,char *from,char *line,struct user *user,...) { if(tailf[i].file) { if(!strcmp(tailf[i].file,line) || tailf[i].inode == st.st_ino) { free(tailf[i].to); + tailf[i].to=0; if(!merp) exit(76); tailf[i].to=strdup(merp); if(mode) { @@ -697,7 +704,9 @@ void c_leetuntail(int fd,char *from,char *line,...) { } tailf[i].fp=0; free(tailf[i].to); + tailf[i].to=0; free(tailf[i].file); + tailf[i].file=0; return; } } @@ -1106,8 +1115,12 @@ void line_handler(int fd,char *line) {//this should be built into the libary? //:armitage.hacking.allowed.org 353 asdf = #default :@SegFault @FreeArtMan @foobaz @wall @Lamb3_13 @gizmore @blackh0le strcpy(tmp,"!"); strcat(tmp,s); + if(ht_getnode(&alias,tmp) == NULL && ht_getnode(&alias,"!###") != NULL) { + strcpy(tmp,"!###"); + } if(ht_getnode(&alias,tmp) != NULL) { - snprintf(tmp,sizeof(tmp),"!%s %s",s,u); + strcat(tmp," "); + strcat(tmp,u);//lol. fixme later. user->nick=strdup("epoch"); user->user=strdup("epoch"); user->host=strdup("localhost"); -- cgit v1.2.3