summaryrefslogtreecommitdiff
path: root/src/inspircd_io.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-07 18:26:38 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-07 18:26:38 +0000
commitdba88edc767697f9c2a9de3c4c2fbaea6cc35f3e (patch)
tree74122d2f9666219c8b4bd047604711f5a2772fa5 /src/inspircd_io.cpp
parentdaff96bf568a51de4e4ec460240e093c43b11ff3 (diff)
Experimental improved string handling in server links
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3127 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd_io.cpp')
-rw-r--r--src/inspircd_io.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index 3788055a4..95f88e357 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -603,11 +603,11 @@ std::string ServerConfig::ConfProcess(char* buffer, long linenumber, std::string
return "";
}
// firstly clean up the line by stripping spaces from the start and end and converting tabs to spaces
- for (unsigned int d = 0; d < strlen(buffer); d++)
- if ((buffer[d]) == 9)
- buffer[d] = ' ';
- while ((buffer[0] == ' ') && (strlen(buffer)>0)) buffer++;
- while ((buffer[strlen(buffer)-1] == ' ') && (strlen(buffer)>0)) buffer[strlen(buffer)-1] = '\0';
+ for (char* d = buffer; *d; d++)
+ if (*d == 9)
+ *d = ' ';
+ while (*buffer == ' ') buffer++;
+ while ((buffer[strlen(buffer)-1] == ' ') && (*buffer)) buffer[strlen(buffer)-1] = '\0';
// empty lines are syntactically valid, as are comments
if (!(*buffer) || buffer[0] == '#')