diff options
author | Steve Slaven <bpk@hoopajoo.net> | 2005-11-22 16:53:09 (GMT) |
---|---|---|
committer | Steve Slaven <bpk@hoopajoo.net> | 2005-11-22 16:53:09 (GMT) |
commit | deb5745614e04b339d8bd5fce29ce9da7109e722 (patch) | |
tree | 3fd302697f665d2fcc7c2b2948427396c576d034 | |
parent | 85afcb685fbcf5dbe52c3aaa46e07b68b8f378f9 (diff) | |
download | powwow-deb5745614e04b339d8bd5fce29ce9da7109e722.zip powwow-deb5745614e04b339d8bd5fce29ce9da7109e722.tar.gz powwow-deb5745614e04b339d8bd5fce29ce9da7109e722.tar.bz2 |
Fix for segfault when viewing a single alias from Kalev Lember
<kalev@smartlink.ee>
#alias foo=bar
#alias foo
Caused segfault
-rw-r--r-- | cmd2.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -216,10 +216,10 @@ void parse_alias __P1 (char *,str) if (*np) { char buf[BUFSIZE]; escape_specials(buf, left); - sprintf(inserted_next, "#alias %s%.*s@%s=%.*s", - BUFSIZE-9, buf, - (*np)->group == NULL ? "*" : (*np)->group, - BUFSIZE-(int)strlen(buf)-9, (*np)->subst); + snprintf(inserted_next, BUFSIZE, "#alias %s@%s=%s", + buf, + (*np)->group == NULL ? "*" : (*np)->group, + (*np)->subst); } else { PRINTF("#unknown alias, cannot show: \"%s\"\n", left); } |