From: Marco van Wieringen Date: Tue, 6 Apr 2010 20:43:09 +0000 (+0200) Subject: Program currval retrieval somewhat more robust. X-Git-Tag: Release-5.0.2~90 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2d02e4b0c13e2f26b138ebb411f6f5e253c91d4d;p=bacula%2Fbacula Program currval retrieval somewhat more robust. --- diff --git a/bacula/src/cats/ingres.c b/bacula/src/cats/ingres.c index af3428b774..b8a85ee5d5 100755 --- a/bacula/src/cats/ingres.c +++ b/bacula/src/cats/ingres.c @@ -647,6 +647,7 @@ static int my_ingres_currval(B_DB *mdb, const char *table_name) char sequence[64]; char query[256]; + char *currval; INGresult *result; int id = 0; @@ -666,7 +667,10 @@ static int my_ingres_currval(B_DB *mdb, const char *table_name) Dmsg0(500, "exec done"); - id = atoi(INGgetvalue(result, 0, 0)); + currval = INGgetvalue(result, 0, 0); + if (currval) { + id = atoi(currval); + } bail_out: INGclear(result);