From 9fd6aff54fa4b554a45841e2f13b401cb34466ab Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 9 Mar 2006 18:18:18 +0000 Subject: Strlen bashing. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3600 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_ident.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/modules/m_ident.cpp') 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)); -- cgit v1.3.1-10-gc9f91