From: Miloš Mulač Date: Thu, 20 Mar 2008 13:19:23 +0000 (+0000) Subject: number events correctly (starting from zero) X-Git-Tag: merge_313_4_after~12 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=63fe6f4549caae0725cdc3d1d83fdc5cc8383ba3;p=jra1mw.git number events correctly (starting from zero) --- 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;