]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_pgsql.cpp
[Taros] Add m_sakick.so
[user/henk/code/inspircd.git] / src / modules / extra / m_pgsql.cpp
index 0484646dfd649ea21c3eea070447909223480a95..b781775809a7c003174e2d4468478d649c193068 100644 (file)
@@ -47,12 +47,10 @@ enum SQLstatus { CREAD, CWRITE, WREAD, WWRITE, RREAD, RWRITE };
 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;
 }
@@ -589,9 +587,6 @@ class SQLConn : public EventHandler
                                /* Total length of the unescaped parameters */
                                unsigned long maxparamlen, paramcount;
 
-                               /* Total length of query, used for binary-safety */
-                               unsigned long querylength = 0;
-
                                /* The length of the longest parameter */
                                maxparamlen = 0;