diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-22 17:18:18 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-22 17:18:18 +0000 |
commit | 4ffd644a14fa40b758f8937b06844861009bfec1 (patch) | |
tree | 53f79a6d5efa581098363f6631d6f7170061bb93 /src/cmd_who.cpp | |
parent | 11e0cbf4dd4356c2791ab04fcec76b58bd44567e (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/cmd_who.cpp')
-rw-r--r-- | src/cmd_who.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd_who.cpp b/src/cmd_who.cpp index 9c74b29eb..bc3c090dd 100644 --- a/src/cmd_who.cpp +++ b/src/cmd_who.cpp @@ -82,8 +82,8 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user) if ((!common_channels(user,i->second)) && (isnick(i->second->nick))) { // Bug Fix #29 - strcpy(tmp, ""); - if (strcmp(i->second->awaymsg, "")) { + *tmp = 0; + if (*i->second->awaymsg) { strlcat(tmp, "G", 9); } else { strlcat(tmp, "H", 9); @@ -120,8 +120,8 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user) if ((has_channel(i->second,Ptr)) && (isnick(i->second->nick))) { // Fix Bug #29 - Part 2.. - strcpy(tmp, ""); - if (strcmp(i->second->awaymsg, "")) { + *tmp = 0; + if (*i->second->awaymsg) { strlcat(tmp, "G", 9); } else { strlcat(tmp, "H", 9); @@ -151,8 +151,8 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user) if (u) { // Bug Fix #29 -- Part 29.. - strcpy(tmp, ""); - if (strcmp(u->awaymsg, "")) { + *tmp = 0; + if (*u->awaymsg) { strlcat(tmp, "G" ,9); } else { strlcat(tmp, "H" ,9); @@ -173,8 +173,8 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user) // If i were a rich man.. I wouldn't need to me making these bugfixes.. // But i'm a poor bastard with nothing better to do. userrec* oper = *i; - strcpy(tmp, ""); - if (strcmp(oper->awaymsg, "")) { + *tmp = 0; + if (*oper->awaymsg) { strlcat(tmp, "G" ,9); } else { strlcat(tmp, "H" ,9); |