From 2d02e4b0c13e2f26b138ebb411f6f5e253c91d4d Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Tue, 6 Apr 2010 22:43:09 +0200 Subject: [PATCH] Program currval retrieval somewhat more robust. --- bacula/src/cats/ingres.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.39.5