summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-18 21:58:53 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-18 21:58:53 +0000
commitb99156d6d6886783a777d0801d519116502d3cd9 (patch)
treee77d5266e875d0aa6aa86b933507df0c2ef61c32 /src
parentece2c5daca87ca8b6759857a27de342e2df98b21 (diff)
Removed all strncpy() calls and replaced with strlcpy()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2818 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/mode.cpp4
-rw-r--r--src/modules/m_antibottler.cpp2
-rw-r--r--src/modules/m_stripcolor.cpp2
-rw-r--r--src/users.cpp6
4 files changed, 7 insertions, 7 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index ec29024e0..c70f4f26a 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -428,8 +428,8 @@ char* ModeParser::AddBan(userrec *user,char *dest,chanrec *chan,int status)
}
b.set_time = TIME;
- strncpy(b.data,dest,MAXBUF);
- strncpy(b.set_by,user->nick,NICKMAX);
+ strlcpy(b.data,dest,MAXBUF);
+ strlcpy(b.set_by,user->nick,NICKMAX);
chan->bans.push_back(b);
return dest;
}
diff --git a/src/modules/m_antibottler.cpp b/src/modules/m_antibottler.cpp
index 7d7f68084..3c0f4e67b 100644
--- a/src/modules/m_antibottler.cpp
+++ b/src/modules/m_antibottler.cpp
@@ -53,7 +53,7 @@ class ModuleAntiBottler : public Module
if (inbound)
{
char data[MAXBUF];
- strncpy(data,raw.c_str(),MAXBUF);
+ strlcpy(data,raw.c_str(),MAXBUF);
bool not_bottler = false;
if (!strncmp(data,"user ",5))
{
diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp
index 4c4b4ad28..625b3fc1a 100644
--- a/src/modules/m_stripcolor.cpp
+++ b/src/modules/m_stripcolor.cpp
@@ -85,7 +85,7 @@ class ModuleStripColor : public Module
{
int i, a, len, remove;
char sentence[MAXBUF];
- strncpy(sentence,text.c_str(),MAXBUF);
+ strlcpy(sentence,text.c_str(),MAXBUF);
len = strlen(sentence);
diff --git a/src/users.cpp b/src/users.cpp
index f7a4dcc09..f6ada52c8 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -372,7 +372,7 @@ void kill_link(userrec *user,const char* r)
char reason[MAXBUF];
- strncpy(reason,r,MAXBUF);
+ strlcpy(reason,r,MAXBUF);
if (strlen(reason)>MAXQUIT)
{
@@ -435,7 +435,7 @@ void kill_link_silent(userrec *user,const char* r)
char reason[MAXBUF];
- strncpy(reason,r,MAXBUF);
+ strlcpy(reason,r,MAXBUF);
if (strlen(reason)>MAXQUIT)
{
@@ -796,7 +796,7 @@ void force_nickchange(userrec* user,const char* newnick)
{
if (newnick)
{
- strncpy(nick,newnick,MAXBUF);
+ strlcpy(nick,newnick,MAXBUF);
}
if (user->registered == 7)
{