summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-04-03 17:25:14 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-04-03 17:25:14 +0000
commitbc461262685ac30a9f4629224a2d09a53190167d (patch)
treed0dd8073575f67169293996a69e340278e856c82 /src
parente8ad4c8cb0d34aaeafd8ef5223b1dccdc752cc51 (diff)
Remove un-needed strlen and pointer in duration()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3805 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/commands.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 1715a9ace..da4deff65 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -216,17 +216,16 @@ long duration(const char* str)
{
char n_field[MAXBUF];
long total = 0;
- const char* str_end = str + strlen(str);
n_field[0] = 0;
if ((!strchr(str,'s')) && (!strchr(str,'m')) && (!strchr(str,'h')) && (!strchr(str,'d')) && (!strchr(str,'w')) && (!strchr(str,'y')))
{
std::string n = str;
- n = n + "s";
+ n += 's';
return duration(n.c_str());
}
- for (char* i = (char*)str; i < str_end; i++)
+ for (char* i = (char*)str; *i; i++)
{
// if we have digits, build up a string for the value in n_field,
// up to 10 digits in size.