summaryrefslogtreecommitdiff
path: root/src/modules/m_ident.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-09 18:18:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-09 18:18:18 +0000
commit9fd6aff54fa4b554a45841e2f13b401cb34466ab (patch)
treeba9d4cc193f325c2990c4976c36701712730db47 /src/modules/m_ident.cpp
parent797c8ac76967a1b0a3fc61b55cf4d3903f019f9a (diff)
Strlen bashing.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3600 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_ident.cpp')
-rw-r--r--src/modules/m_ident.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index 821576df8..a4a7fa34c 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -71,11 +71,10 @@ class RFC1413 : public InspSocket
if (section)
{
while (*section == ' ') section++; // strip leading spaces
- int t = strlen(section);
- for (int j = 0; j < t; j++)
- if ((section[j] < 33) || (section[j]>126))
- section[j] = '\0'; // truncate at invalid chars
- if (strlen(section))
+ for (char* j = section; *j; j++)
+ if ((*j < 33) || (*j > 126))
+ *j = '\0'; // truncate at invalid chars
+ if (*section)
{
strlcpy(u->ident,section,IDENTMAX);
Srv->Log(DEBUG,"IDENT SET: "+std::string(u->ident));