From 84efd5e969d045326f154132cbd5960290e1093d Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Wed, 8 Jan 2003 23:13:45 +0000 Subject: [PATCH] - Removed strl[cat|cpy]() function calls ... --- src/ngircd/client.c | 5 +++-- src/ngircd/irc-mode.c | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ngircd/client.c b/src/ngircd/client.c index 2a4bf3f3..383aa78c 100644 --- a/src/ngircd/client.c +++ b/src/ngircd/client.c @@ -17,7 +17,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: client.c,v 1.65.2.2 2003/01/08 23:09:04 alex Exp $"; +static char UNUSED id[] = "$Id: client.c,v 1.65.2.3 2003/01/08 23:13:45 alex Exp $"; #include "imp.h" #include @@ -399,7 +399,8 @@ Client_SetAway( CLIENT *Client, CHAR *Txt ) assert( Client != NULL ); assert( Txt != NULL ); - strlcpy( Client->away, Txt, sizeof( Client->away )); + strncpy( Client->away, Txt, CLIENT_AWAY_LEN - 1 ); + Client->away[CLIENT_AWAY_LEN - 1] = '\0'; Log( LOG_DEBUG, "User \"%s\" is away: %s", Client_Mask( Client ), Txt ); } /* Client_SetAway */ diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index b5e879c6..e3cd6396 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-mode.c,v 1.24.2.2 2003/01/08 23:08:12 alex Exp $"; +static char UNUSED id[] = "$Id: irc-mode.c,v 1.24.2.3 2003/01/08 23:13:45 alex Exp $"; #include "imp.h" #include @@ -252,7 +252,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel ) if( ! Channel_IsMemberOf( Channel, Origin )) return IRC_WriteStrClient( Origin, RPL_CHANNELMODEIS_MSG, Client_ID( Origin ), Channel_Name( Channel ), Channel_Modes( Channel )); /* The sender is a member: generate extended reply */ - strlcpy( the_modes, Channel_Modes( Channel ), sizeof( the_modes )); + strcpy( the_modes, Channel_Modes( Channel )); mode_ptr = the_modes; strcpy( the_args, "" ); while( *mode_ptr ) @@ -261,16 +261,16 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel ) { case 'l': snprintf( argadd, sizeof( argadd ), " %ld", Channel_MaxUsers( Channel )); - strlcat( the_args, argadd, sizeof( the_args )); + strcat( the_args, argadd ); break; case 'k': - strlcat( the_args, " ", sizeof( the_args )); - strlcat( the_args, Channel_Key( Channel ), sizeof( the_args )); + strcat( the_args, " " ); + strcat( the_args, Channel_Key( Channel )); break; } mode_ptr++; } - if( the_args[0] ) strlcat( the_modes, the_args, sizeof( the_modes )); + if( the_args[0] ) strcat( the_modes, the_args ); return IRC_WriteStrClient( Origin, RPL_CHANNELMODEIS_MSG, Client_ID( Origin ), Channel_Name( Channel ), the_modes ); }