struct custom_prepare_struct {
const char *sql;
const char *extra;
- va_list *ap;
+ va_list ap;
};
static SQLHSTMT custom_prepare(struct odbc_obj *obj, void *data)
const char *newparam, *newval;
SQLHSTMT stmt;
va_list ap;
- va_copy(ap, *(cps->ap));
+
+ va_copy(ap, cps->ap);
res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
SQLSMALLINT nullable;
SQLLEN indicator;
va_list aq;
- struct custom_prepare_struct cps = { .sql = sql, .ap = &ap };
-
+ struct custom_prepare_struct cps = { .sql = sql };
+
+ va_copy(cps.ap, ap);
va_copy(aq, ap);
if (!table)
SQLSMALLINT decimaldigits;
SQLSMALLINT nullable;
SQLLEN indicator;
- struct custom_prepare_struct cps = { .sql = sql, .ap = &ap };
-
+ struct custom_prepare_struct cps = { .sql = sql };
va_list aq;
+
+ va_copy(cps.ap, ap);
va_copy(aq, ap);
if (!table)
const char *newparam, *newval;
int res;
va_list aq;
- struct custom_prepare_struct cps = { .sql = sql, .ap = &ap, .extra = lookup };
-
+ struct custom_prepare_struct cps = { .sql = sql, .extra = lookup };
+
+ va_copy(cps.ap, ap);
va_copy(aq, ap);
if (!table)