From 07cdd587b487b37f264b22e6b08923178c94cc10 Mon Sep 17 00:00:00 2001 From: Tim Cava Date: Wed, 23 Oct 2013 17:33:50 +0000 Subject: [PATCH] Cleanup ircop_flags_to_str. Make the bufsize IRCD_BUFFER_SIZE instead of BIG_BUFFER_SIZE. Even with many flags enabled the output string shouldn't be larger than 512 bytes. Use strlcat rather than strmcat. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@407 13b04d17-f746-0410-82c6-800466cd88b0 --- source/notice.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/notice.c b/source/notice.c index ef96d34..09c6623 100644 --- a/source/notice.c +++ b/source/notice.c @@ -1050,15 +1050,15 @@ int i, j; char *ircop_flags_to_str(long flag) { -int p, i; -char *buffer = new_malloc(BIG_BUFFER_SIZE+1); + int i, p; + char *buffer = new_malloc(IRCD_BUFFER_SIZE); for (i = 0, p = 1; opflags[i]; i++, p <<= 1) { if (flag & p) { - strmcat(buffer, opflags[i], BIG_BUFFER_SIZE); - strmcat(buffer, ",", BIG_BUFFER_SIZE); + strlcat(buffer, opflags[i], sizeof buffer); + strlcat(buffer, ",", sizeof buffer); } } if (*buffer)