mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-10-08 00:14:37 +08:00
Merge pull request #313 from jwrdegoede/fedora34-compile-fix
Fix -Werror=array-bounds compile error in src/odbc/odbc.c
This commit is contained in:
@@ -979,12 +979,13 @@ SQLRETURN SQL_API SQLErrorW(
|
||||
result = SQLError(henv, hdbc, hstmt, szSqlState8, pfNativeError, szErrorMsg8, 3*cbErrorMsgMax+1, &pcbErrorMsg8);
|
||||
if (result == SQL_SUCCESS) {
|
||||
struct _hdbc *dbc = hstmt ? ((struct _hstmt *)hstmt)->hdbc : hdbc;
|
||||
size_t l=6, z=6*sizeof(SQLWCHAR);
|
||||
ascii2unicode(dbc, (char*)szSqlState8, &l, (char*)szSqlState, &z);
|
||||
l = cbErrorMsgMax;
|
||||
ascii2unicode(dbc, (char*)szErrorMsg8, (size_t*)&pcbErrorMsg8, (char*)szErrorMsg, &l);
|
||||
size_t lin=6, lout=6*sizeof(SQLWCHAR);
|
||||
ascii2unicode(dbc, (char*)szSqlState8, &lin, (char*)szSqlState, &lout);
|
||||
lin = pcbErrorMsg8;
|
||||
lout = cbErrorMsgMax;
|
||||
ascii2unicode(dbc, (char*)szErrorMsg8, &lin, (char*)szErrorMsg, &lout);
|
||||
if (pcbErrorMsg)
|
||||
*pcbErrorMsg = l;
|
||||
*pcbErrorMsg = lout;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user