diff options
Diffstat (limited to 'src/modules/extra/m_sqlite3.cpp')
-rw-r--r-- | src/modules/extra/m_sqlite3.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp index d174ce8aa..c4d1cc799 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -34,12 +34,10 @@ typedef std::deque<SQLite3Result*> ResultQueue; unsigned long count(const char * const str, char a) { unsigned long n = 0; - const char *p = reinterpret_cast<const char *>(str); - - while ((p = strchr(p, a)) != NULL) + for (const char *p = reinterpret_cast<const char *>(str); *p; ++p) { - ++p; - ++n; + if (*p == '?') + ++n; } return n; } |