X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Flists.c;h=f6e710c687927f16a49bbfc1c9789c6a3cfd1a08;hp=4f3c59e0c559ab335f2e978206808e78f21cf6c5;hb=6626395c88fc46eeb110942b17eb9245a1d0021b;hpb=74ff9828de772fc4ccc5715be20a1cb613bb339d diff --git a/src/ngircd/lists.c b/src/ngircd/lists.c index 4f3c59e0..f6e710c6 100644 --- a/src/ngircd/lists.c +++ b/src/ngircd/lists.c @@ -2,21 +2,20 @@ * ngIRCd -- The Next Generation IRC Daemon * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) * - * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen - * der GNU General Public License (GPL), wie von der Free Software Foundation - * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 - * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. - * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste - * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * Please read the file COPYING, README and AUTHORS for more information. * - * $Id: lists.c,v 1.9 2002/10/03 21:49:59 alex Exp $ - * - * lists.c: Verwaltung der "IRC-Listen": Ban, Invite, ... + * Management of IRC lists: ban, invite, ... */ #include "portab.h" +static char UNUSED id[] = "$Id: lists.c,v 1.11 2002/12/26 16:25:43 alex Exp $"; + #include "imp.h" #include @@ -332,19 +331,17 @@ Lists_MakeMask( CHAR *Pattern ) if(( ! at ) && ( ! excl )) { - /* weder ! noch @ĂŠvorhanden: als Nick annehmen */ - strncpy( TheMask, Pattern, MASK_LEN - 5 ); - TheMask[MASK_LEN - 5] = '\0'; - strcat( TheMask, "!*@*" ); + /* weder ! noch @ vorhanden: als Nick annehmen */ + strlcpy( TheMask, Pattern, sizeof( TheMask ) - 5 ); + strlcat( TheMask, "!*@*", sizeof( TheMask )); return TheMask; } if(( ! at ) && ( excl )) { /* Domain fehlt */ - strncpy( TheMask, Pattern, MASK_LEN - 3 ); - TheMask[MASK_LEN - 3] = '\0'; - strcat( TheMask, "@*" ); + strlcpy( TheMask, Pattern, sizeof( TheMask ) - 3 ); + strlcat( TheMask, "@*", sizeof( TheMask )); return TheMask; } @@ -352,17 +349,14 @@ Lists_MakeMask( CHAR *Pattern ) { /* User fehlt */ *at = '\0'; at++; - strncpy( TheMask, Pattern, MASK_LEN - 4 ); - TheMask[MASK_LEN - 4] = '\0'; - strcat( TheMask, "!*@" ); - strncat( TheMask, at, strlen( TheMask ) - MASK_LEN - 1 ); - TheMask[MASK_LEN - 1] = '\0'; + strlcpy( TheMask, Pattern, sizeof( TheMask ) - strlen( at ) - 4 ); + strlcat( TheMask, "!*@", sizeof( TheMask )); + strlcat( TheMask, at, sizeof( TheMask )); return TheMask; } /* alle Teile vorhanden */ - strncpy( TheMask, Pattern, MASK_LEN - 1 ); - TheMask[MASK_LEN - 1] = '\0'; + strlcpy( TheMask, Pattern, sizeof( TheMask )); return TheMask; } /* Lists_MakeMask */ @@ -383,7 +377,7 @@ New_C2C( CHAR *Mask, CHANNEL *Chan, BOOLEAN OnlyOnce ) return NULL; } - strncpy( c2c->mask, Mask, MASK_LEN ); + strlcpy( c2c->mask, Mask, sizeof( c2c->mask )); c2c->channel = Chan; c2c->onlyonce = OnlyOnce;