Ejemplo n.º 1
0
void CDBCmd::SetQuery(const char* sql)
{
	char tmp[8192];
	BackSlash(tmp, 8192, sql);
	m_sql = tmp;
	m_sqlLen = m_sql.Length();
}
Ejemplo n.º 2
0
char *
BackSlashDecode(const char *s, const char *e)
{
    const char *q;
    char *p, *r;
    int i;

    if (e == NULL)
        e = strchr(s, '\0');
    assert(e != NULL);
    p = calloc((e - s) + 1, 1);
    if (p == NULL)
        return (p);
    for (r = p, q = s; q < e; ) {
        if (*q != '\\') {
            *r++ = *q++;
            continue;
        }
        i = BackSlash(q, r);
        q += i;
        r++;
    }
    *r = '\0';
    return (p);
}