Skip to content

Commit

Permalink
Don't use deprecated isc_interprete() in Firebird backend.
Browse files Browse the repository at this point in the history
Using isc_interprete() is unsafe because it doesn't take the buffer size and
results in deprecation warnings with Firebird 2.x. Use the new fb_interpret()
instead to fix both problems.

Notice that this breaks compilation with Firebird 1.x but hopefully this is
not a problem as it's pretty old by now.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
  • Loading branch information
vadz committed Jul 6, 2012
1 parent 578a8f4 commit ce9657b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/backends/firebird/error-firebird.cpp
Expand Up @@ -37,16 +37,16 @@ namespace firebird
void get_iscerror_details(ISC_STATUS * status_vector, std::string &msg)
{
char msg_buffer[SOCI_FIREBIRD_ERRMSG];
ISC_STATUS *pvector = status_vector;
const ISC_STATUS *pvector = status_vector;

try
{
// fetching first error message
isc_interprete(msg_buffer, &pvector);
fb_interpret(msg_buffer, SOCI_FIREBIRD_ERRMSG, &pvector);
msg = msg_buffer;

// fetching next errors
while (isc_interprete(msg_buffer, &pvector))
while (fb_interpret(msg_buffer, SOCI_FIREBIRD_ERRMSG, &pvector))
{
msg += "\n";
msg += msg_buffer;
Expand Down

0 comments on commit ce9657b

Please sign in to comment.