From c3b861b2507dd2ef52802c69a2d737925846e2e0 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 2 Mar 2006 19:34:57 +0000 Subject: Added IS_SINGLE, see comment in include/inspircd.h git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3438 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_who.cpp | 4 ++-- src/inspircd_io.cpp | 2 +- src/mode.cpp | 6 +++--- src/svn-rev.sh | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/cmd_who.cpp b/src/cmd_who.cpp index 624006758..307e86d91 100644 --- a/src/cmd_who.cpp +++ b/src/cmd_who.cpp @@ -70,7 +70,7 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user) /* theres more to do here, but for now just close the socket */ if (pcnt == 1) { - if ((!strcmp(parameters[0],"0")) || (!strcmp(parameters[0],"*"))) + if ((IS_SINGLE(parameters[0],'0)) || (IS_SINGLE(parameters[0],'*'))) { if ((user->chans.size()) && (user->chans[0].channel)) { @@ -165,7 +165,7 @@ void cmd_who::Handle (char **parameters, int pcnt, userrec *user) } if (pcnt == 2) { - if ((!strcmp(parameters[0],"0")) || (!strcmp(parameters[0],"*")) && (!strcmp(parameters[1],"o"))) + if ((IS_SINGLE(parameters[0],'0')) || (IS_SINGLE(parameters[0],'*')) && (IS_SINGLE(parameters[1],'o'))) { for (std::vector::iterator i = all_opers.begin(); i != all_opers.end(); i++) { diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index c0cf997b0..e47cf9dda 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -1183,7 +1183,7 @@ int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server struct in_addr addy; inet_aton(addr,&addy); server.sin_family = AF_INET; - if (!strcmp(addr,"")) + if (!*addr) { server.sin_addr.s_addr = htonl(INADDR_ANY); } diff --git a/src/mode.cpp b/src/mode.cpp index 30000dfe2..f14c3bcb5 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -1460,10 +1460,10 @@ void cmd_mode::Handle (char **parameters, int pcnt, userrec *user) if ((b[z] == '-') || (b[z] == '+')) b[z] = '\0'; - if ((!b[0]) || (!strcmp(b,"+")) || (!strcmp(b,"-"))) + if ((!*b) || (IS_SINGLE(b,"+")) || (IS_SINGLE(b,"-"))) return; - if (strcmp(b,"")) + if (*b) { WriteTo(user, dest, "MODE %s :%s", dest->nick, b); FOREACH_MOD(I_OnMode,OnMode(user, dest, TYPE_USER, b)); @@ -1711,7 +1711,7 @@ void ModeParser::ServerMode(char **parameters, int pcnt, userrec *user) if ((b[z] == '-') || (b[z] == '+')) b[z] = '\0'; - if ((!b[0]) || (!strcmp(b,"+")) || (!strcmp(b,"-"))) + if ((!*b) || (IS_SINGLE(b,'+')) || (IS_SINGLE(b,'-'))) return; if (*b) diff --git a/src/svn-rev.sh b/src/svn-rev.sh index 2d41e01be..9b66cc15d 100755 --- a/src/svn-rev.sh +++ b/src/svn-rev.sh @@ -1 +1 @@ -echo 3434 +echo 3437 -- cgit v1.2.3