diff --git a/src/odbc/odbc.c b/src/odbc/odbc.c index 439fb94..d6d1855 100644 --- a/src/odbc/odbc.c +++ b/src/odbc/odbc.c @@ -1984,14 +1984,14 @@ SQLRETURN SQL_API SQLDataSources( static int _odbc_fix_literals(struct _hstmt *stmt) { - char tmp[4096],begin_tag[11]; + char tmp[4096]; char *s, *d, *p; int i, quoted = 0, find_end = 0; char quote_char; s=stmt->query; d=tmp; - while (*s) { + while (*s && dquery,tmp); + + snprintf(stmt->query, sizeof(stmt->query), "%.*s", (int)(d-tmp), tmp); return 0; }