size_t sqliteescapestring(char *buf, char *src, unsigned int len) {
unsigned int i;
- char *p;
+ char *p, *d;
- for(p=src,i=0;i<len;i++,p++) {
+ for(p=src,d=buf,i=0;i<len;i++,p++) {
if(*p == '\'')
- *buf++ = *p;
- *buf++ = *p;
+ *d++ = *p;
+ *d++ = *p;
}
- *buf = '\0';
+ *d = '\0';
- return p - buf;
+ return d - buf;
}
SQLiteResult *sqlitegetresult(SQLiteConn *r) {
/* the handlers do all the checking and cleanup */
if(t->init)
- (t->init)(c, t->tag);
+ (t->init)(NULL, t->tag);
(t->data)(c, t->tag);
if(t->fini)
- (t->fini)(c, t->tag);
+ (t->fini)(NULL, t->tag);
nsfree(POOL_SQLITE, t);
}