summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-22 17:18:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-22 17:18:18 +0000
commit4ffd644a14fa40b758f8937b06844861009bfec1 (patch)
tree53f79a6d5efa581098363f6631d6f7170061bb93 /src/mode.cpp
parent11e0cbf4dd4356c2791ab04fcec76b58bd44567e (diff)
Optimized out strcpys that copy empty strings (craq++)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2637 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 7d401d7e3..de994dd5b 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -1289,7 +1289,8 @@ void cmd_mode::Handle (char **parameters, int pcnt, userrec *user)
return;
}
- strcpy(outpars,"+");
+ outpars[0] = '+';
+ outpars[1] = 0;
direction = 1;
if ((parameters[1][0] != '+') && (parameters[1][0] != '-'))
@@ -1383,7 +1384,7 @@ void cmd_mode::Handle (char **parameters, int pcnt, userrec *user)
outpars[r+1]='\0';
outpars[r] = parameters[1][i];
- strcpy(temp,"");
+ *temp = 0;
for (q = 0; q < strlen(dmodes); q++)
{
if (dmodes[q] != parameters[1][i])
@@ -1555,7 +1556,8 @@ void ModeParser::ServerMode(char **parameters, int pcnt, userrec *user)
char dmodes[MAXBUF];
strlcpy(dmodes,dest->modes,52);
- strcpy(outpars,"+");
+ outpars[0] = '+';
+ outpars[1] = 0;
direction = 1;
if ((parameters[1][0] != '+') && (parameters[1][0] != '-'))
@@ -1639,8 +1641,7 @@ void ModeParser::ServerMode(char **parameters, int pcnt, userrec *user)
unsigned int v1 = strlen(outpars);
outpars[v1+1]='\0';
outpars[v1] = parameters[1][i];
-
- strcpy(temp,"");
+ *temp = 0;
for (q = 0; q < strlen(dmodes); q++)
{
if (dmodes[q] != parameters[1][i])