1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

Update extban_conv_param_nuh_or_extban() to use MAXBANLEN

instead of arbitrary 256 and such. Also makes it so other people
reading this code will understand better that MAXBANLEN is the
real limit here and not 256 (which is never reached because
the cut off already happens at 200).
This commit is contained in:
Bram Matthys
2026-02-22 12:42:44 +01:00
parent d38a106879
commit 6933e1839b
+4 -5
View File
@@ -384,13 +384,12 @@ const char *extban_conv_param_nuh(BanContext *b, Extban *extban)
*/
const char *extban_conv_param_nuh_or_extban(BanContext *b, Extban *self_extban)
{
#if (USERLEN + NICKLEN + HOSTLEN + 32) > 256
#error "wtf?"
#if (NICKLEN + USERLEN + HOSTLEN + 32) > MAXBANLEN
#error "MAXBANLEN is not sufficient to hold n!u@h plus some extra for extban prefixes. wtf?"
#endif
static char retbuf[256];
static char printbuf[256];
static char retbuf[MAXBANLEN+1];
char *mask;
char tmpbuf[USERLEN + NICKLEN + HOSTLEN + 32];
char tmpbuf[MAXBANLEN+1];
const char *ret = NULL;
const char *nextbanstr;
Extban *extban = NULL;