From ffea653764c628cc689945c673c0b615b99a35c8 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Sat, 16 Nov 2013 03:13:26 +0000 Subject: [PATCH] Fix the /TKB (timed kickban) command. An incorrect pointer was being passed to malloc_sprintf(), causing a crash. Use m_sprintf() instead. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@471 13b04d17-f746-0410-82c6-800466cd88b0 --- Changelog | 2 ++ source/banlist.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index 78311e3..355b69d 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2c01] +* Fix the /TKB (timed kickban) command. (caf) + * Rewrite termcap/terminfo detection logic in configure and include term.h in term.c for the system definition of tparm(). This fixes a crash on NetBSD x86-64 (reported by jeezy), and should also ensure that terminfo diff --git a/source/banlist.c b/source/banlist.c index 29d93bf..9ff540e 100644 --- a/source/banlist.c +++ b/source/banlist.c @@ -1021,16 +1021,16 @@ BUILT_IN_COMMAND(kickban) reset_display_target(); return; } + if (command && (!my_stricmp(command, "TBK") || !my_stricmp(command, "TKB"))) { char *string_time; time = get_cset_int_var(chan->csets, BANTIME_CSET); if ((string_time = next_arg(args, &args))) time = atoi(string_time); - malloc_sprintf(&rest, "Timed kickban for %s", convert_time(time)); rest = args; - if (rest && !*rest) - rest = NULL; + if (!rest || !*rest) + rest = m_sprintf("Timed kickban for %s", convert_time(time)); } else {