--- freeradius-server-2.1.3.orig/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/sql_unixodbc.c 2008-12-05 11:37:56.000000000 -0500 +++ freeradius-server-2.1.3/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/sql_unixodbc.c 2009-02-24 09:51:23.000000000 -0500 @@ -166,7 +166,8 @@ *************************************************************************/ static int sql_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; - SQLINTEGER column, len; + SQLINTEGER column; + SQLLEN len; int numfields; int state; @@ -184,7 +185,7 @@ for(column=1; column<=numfields; column++) { SQLColAttributes(unixodbc_sock->stmt_handle,((SQLUSMALLINT) column),SQL_COLUMN_LENGTH,NULL,0,NULL,&len); - unixodbc_sock->row[column-1] = (SQLCHAR*)rad_malloc((int)++len); + unixodbc_sock->row[column-1] = (char*)rad_malloc((int)++len); SQLBindCol(unixodbc_sock->stmt_handle, column, SQL_C_CHAR, (SQLCHAR *)unixodbc_sock->row[column-1], len, NULL); } return 0; @@ -440,9 +441,9 @@ static int sql_affected_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; long err_handle; - int affected_rows; + SQLLEN affected_rows; - err_handle = SQLRowCount(unixodbc_sock->stmt_handle, (SQLINTEGER *)&affected_rows); + err_handle = SQLRowCount(unixodbc_sock->stmt_handle, &affected_rows); if (sql_state(err_handle, sqlsocket, config)) return -1;