From c41048b896d4065a72385b52d7bbf826686cef68 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Tue, 14 Oct 2014 12:57:01 +0000 Subject: [PATCH] Increase size of buffer to handle maximum-length topics in status_topic(). This affects the maximum length of the topic that can be displayed by the %- status format. No topic can be longer than IRCD_BUFFER_SIZE, so use that. Reported by oxy. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@508 13b04d17-f746-0410-82c6-800466cd88b0 --- Changelog | 2 ++ source/status.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index 005fdd6..b054397 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2c01] +* Allow %- status format to handle max-length topics (reported by oxy). (caf) + * Add /FSET WOHIS_LOGGEDIN for services login info on hybrid, ratbox and ircu. (caf) diff --git a/source/status.c b/source/status.c index 79e8c53..3640a73 100644 --- a/source/status.c +++ b/source/status.c @@ -1301,7 +1301,8 @@ static char my_buffer[MY_BUFFER/2+1]; static char *status_topic (Window *window) { -static char my_buffer[MY_BUFFER+41]; + static char my_buffer[IRCD_BUFFER_SIZE]; + if (window && window->current_channel && window->wset->topic_format) { ChannelList *chan; @@ -1315,11 +1316,11 @@ static char my_buffer[MY_BUFFER+41]; double_quote(t, "()[]$\"", t2); else strcpy(t2, t); - snprintf(my_buffer, MY_BUFFER, window->wset->topic_format, stripansicodes(t2)); + snprintf(my_buffer, sizeof my_buffer, window->wset->topic_format, stripansicodes(t2)); } else strlcpy(my_buffer, "No Topic", sizeof my_buffer); - return(my_buffer); + return my_buffer; } } RETURN_EMPTY;