From 63fe6f4549caae0725cdc3d1d83fdc5cc8383ba3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Thu, 20 Mar 2008 13:19:23 +0000 Subject: [PATCH] number events correctly (starting from zero) --- org.glite.lb.server/src/store.c.T | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.glite.lb.server/src/store.c.T b/org.glite.lb.server/src/store.c.T index 0afa6b3..40bd32b 100644 --- a/org.glite.lb.server/src/store.c.T +++ b/org.glite.lb.server/src/store.c.T @@ -125,7 +125,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int edg_wll_FetchRow(ctx,sh,1,NULL,&max) < 0) goto clean; glite_lbu_FreeStmt(&sh); - next = (max && *max) ? atoi(max)+1 : 0; + next = (max && *max) ? atoi(max) : 0; free(max); @@ -145,7 +145,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int /* increase number of stored events */ trio_asprintf(&stmt, "update jobs set nevents='%d'" - "where jobid = '%|Ss'", next, jobid); + "where jobid = '%|Ss'", next+1, jobid); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto clean; free(stmt); stmt = NULL; -- 1.8.2.3