From 13c5cb7845b957966b9ecb1a8c2e48afb8d69233 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 11 Feb 2009 23:47:06 +0000 Subject: I really dont get the oddball count()? rewrite it git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11088 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_mssql.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/modules/extra/m_mssql.cpp') diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp index 65f86e9ac..0b197efe5 100644 --- a/src/modules/extra/m_mssql.cpp +++ b/src/modules/extra/m_mssql.cpp @@ -37,12 +37,10 @@ typedef std::deque ResultQueue; unsigned long count(const char * const str, char a) { unsigned long n = 0; - const char *p = reinterpret_cast(str); - - while ((p = strchr(p, a)) != NULL) + for (const char *p = reinterpret_cast(str); *p; ++p) { - ++p; - ++n; + if (*p == '?') + ++n; } return n; } -- cgit v1.2.3