diff options
Diffstat (limited to 'src/modules/m_ident.cpp')
-rw-r--r-- | src/modules/m_ident.cpp | 9 |
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)); |