summaryrefslogtreecommitdiff
path: root/src/cmd_who.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-02 11:45:38 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-02 11:45:38 +0000
commit99f6009b2d0d1bc4b7ddc09f164fc19b78e6b431 (patch)
tree0e730986a55816e53ff990d1af443e5883982fec /src/cmd_who.cpp
parent21a1aec26cfa93e468912080c60d92c4d43b0f0c (diff)
Added charlcat which appends a single char to a char* string (range checked)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3416 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_who.cpp')
-rw-r--r--src/cmd_who.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/cmd_who.cpp b/src/cmd_who.cpp
index ecb52ea29..624006758 100644
--- a/src/cmd_who.cpp
+++ b/src/cmd_who.cpp
@@ -84,11 +84,11 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user)
// Bug Fix #29
*tmp = 0;
if (*i->second->awaymsg) {
- strlcat(tmp, "G", 9);
+ charlcat(tmp, 'G', 9);
} else {
- strlcat(tmp, "H", 9);
+ charlcat(tmp, 'H', 9);
}
- if (*i->second->oper) { strlcat(tmp, "*", 9); }
+ if (*i->second->oper) { charlcat(tmp, '*', 9); }
WriteServ(user->fd,"352 %s %s %s %s %s %s %s :0 %s",user->nick, Ptr ? Ptr->name : "*", i->second->ident, i->second->dhost, i->second->server, i->second->nick, tmp, i->second->fullname);
if (n_list++ > Config->MaxWhoResults)
{
@@ -121,11 +121,11 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user)
// Fix Bug #29 - Part 2..
*tmp = 0;
if (*i->second->awaymsg) {
- strlcat(tmp, "G", 9);
+ charlcat(tmp, 'G', 9);
} else {
- strlcat(tmp, "H", 9);
+ charlcat(tmp, 'H', 9);
}
- if (*i->second->oper) { strlcat(tmp, "*", 9); }
+ if (*i->second->oper) { charlcat(tmp, '*', 9); }
strlcat(tmp, cmode(i->second, Ptr),5);
WriteServ(user->fd,"352 %s %s %s %s %s %s %s :0 %s",user->nick, Ptr->name, i->second->ident, i->second->dhost, i->second->server, i->second->nick, tmp, i->second->fullname);
n_list++;
@@ -152,11 +152,11 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user)
// Bug Fix #29 -- Part 29..
*tmp = 0;
if (*u->awaymsg) {
- strlcat(tmp, "G" ,9);
+ charlcat(tmp, 'G' ,9);
} else {
- strlcat(tmp, "H" ,9);
+ charlcat(tmp, 'H' ,9);
}
- if (*u->oper) { strlcat(tmp, "*" ,9); }
+ if (*u->oper) { charlcat(tmp, '*' ,9); }
WriteServ(user->fd,"352 %s %s %s %s %s %s %s :0 %s",user->nick, u->chans.size() && u->chans[0].channel ? u->chans[0].channel->name
: "*", u->ident, u->dhost, u->server, u->nick, tmp, u->fullname);
}
@@ -174,9 +174,9 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user)
userrec* oper = *i;
*tmp = 0;
if (*oper->awaymsg) {
- strlcat(tmp, "G" ,9);
+ charlcat(tmp, 'G' ,9);
} else {
- strlcat(tmp, "H" ,9);
+ charlcat(tmp, 'H' ,9);
}
WriteServ(user->fd,"352 %s %s %s %s %s %s %s* :0 %s", user->nick, oper->chans.size() && oper->chans[0].channel ? oper->chans[0].channel->name
: "*", oper->ident, oper->dhost, oper->server, oper->nick, tmp, oper->fullname);
@@ -187,4 +187,3 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user)
}
}
-