diff options
author | epochqwert <epoch@hacking.allowed.org> | 2015-05-18 00:54:47 -0500 |
---|---|---|
committer | epochqwert <epoch@hacking.allowed.org> | 2015-05-18 00:54:47 -0500 |
commit | 58b36e35a16284c02bf3fe699056806f0981ae93 (patch) | |
tree | e9dcc296173ea1f603cf6d9584f922bd3a9302ca /segfault.c | |
parent | 1432454e2c60cd12e35739e217dfb1c3ead19a41 (diff) | |
download | segfault-58b36e35a16284c02bf3fe699056806f0981ae93.tar.gz segfault-58b36e35a16284c02bf3fe699056806f0981ae93.zip |
fixed a crash in !builtins and !aliases due to... something.
Diffstat (limited to 'segfault.c')
-rw-r--r-- | segfault.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -560,6 +560,7 @@ void c_builtin(int fd,char *from,char *line,...) { void c_builtins(int fd,char *from,char *line,...) { char tmp[512]; + struct hitem *hi; struct entry *m; int i,j=0,k=0; if(!line){ @@ -571,13 +572,18 @@ void c_builtins(int fd,char *from,char *line,...) { snprintf(tmp,sizeof(tmp)-1,"builtins in bucket: %d",builtin.keys[i]); privmsg(fd,from,tmp); } - for(m=builtin.bucket[builtin.keys[i]]->ll;m;m=m->next) { - if(strcasestr(m->original,line) || *line=='*') { - snprintf(tmp,sizeof(tmp)-1," %s -> %p",m->original,m->target); - privmsg(fd,from,tmp); - j++; + hi=builtin.bucket[builtin.keys[i]]; + if(hi) { + for(m=builtin.bucket[builtin.keys[i]]->ll;m;m=m->next) { + if(strcasestr(m->original,line) || *line=='*') { + snprintf(tmp,sizeof(tmp)-1," %s -> %p",m->original,m->target); + privmsg(fd,from,tmp); + j++; + } + k++; } - k++; + } else { + privmsg(fd,from,"what the fuck? this bucket isn't set!"); } } snprintf(tmp,sizeof(tmp)-1,"found %d of %d in builtins",j,k); |