Skip to content

Commit

Permalink
[AD-794] Correct call in SQLError with regards to buffer length inter…
Browse files Browse the repository at this point in the history
…pretation.
  • Loading branch information
Bruce Irschick committed Jun 17, 2022
1 parent 9cef585 commit f6b1904
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/odbc/src/odbc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1552,8 +1552,9 @@ SQLRETURN SQLError(SQLHENV env, SQLHDBC conn, SQLHSTMT stmt, SQLWCHAR* state,

std::string errMsg = record.GetMessageText();
LOG_DEBUG_MSG("SQLError calling CopyStringToBuffer(errMsg, msgBuf,static_cast< size_t >(msgBufLen), true);");
size_t outResLen = CopyStringToBuffer(errMsg, msgBuf,
static_cast< size_t >(msgBufLen), true);
// This buffer length is given in characters, not bytes.
size_t outResLen =
CopyStringToBuffer(errMsg, msgBuf, static_cast< size_t >(msgBufLen));

if (msgResLen)
*msgResLen = static_cast< SQLSMALLINT >(outResLen);
Expand Down

0 comments on commit f6b1904

Please sign in to comment.