mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +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);
|
result = SQLError(henv, hdbc, hstmt, szSqlState8, pfNativeError, szErrorMsg8, 3*cbErrorMsgMax+1, &pcbErrorMsg8);
|
||||||
if (result == SQL_SUCCESS) {
|
if (result == SQL_SUCCESS) {
|
||||||
struct _hdbc *dbc = hstmt ? ((struct _hstmt *)hstmt)->hdbc : hdbc;
|
struct _hdbc *dbc = hstmt ? ((struct _hstmt *)hstmt)->hdbc : hdbc;
|
||||||
size_t l=6, z=6*sizeof(SQLWCHAR);
|
size_t lin=6, lout=6*sizeof(SQLWCHAR);
|
||||||
ascii2unicode(dbc, (char*)szSqlState8, &l, (char*)szSqlState, &z);
|
ascii2unicode(dbc, (char*)szSqlState8, &lin, (char*)szSqlState, &lout);
|
||||||
l = cbErrorMsgMax;
|
lin = pcbErrorMsg8;
|
||||||
ascii2unicode(dbc, (char*)szErrorMsg8, (size_t*)&pcbErrorMsg8, (char*)szErrorMsg, &l);
|
lout = cbErrorMsgMax;
|
||||||
|
ascii2unicode(dbc, (char*)szErrorMsg8, &lin, (char*)szErrorMsg, &lout);
|
||||||
if (pcbErrorMsg)
|
if (pcbErrorMsg)
|
||||||
*pcbErrorMsg = l;
|
*pcbErrorMsg = lout;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user