From a0f7d0d7224dbe0ccaca97bae8d4c9e5ea0fa561 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Mon, 10 Oct 2005 19:36:58 +0000 Subject: [PATCH] - casts to avoid warnings - bad printf format string --- org.glite.lb.client/src/dump.c | 12 ++++++------ org.glite.lb.client/src/lb_dump_exporter.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/org.glite.lb.client/src/dump.c b/org.glite.lb.client/src/dump.c index f172192..8459199 100644 --- a/org.glite.lb.client/src/dump.c +++ b/org.glite.lb.client/src/dump.c @@ -100,22 +100,22 @@ int main(int argc,char *argv[]) if (debug) { printf("Dump request:\n"); if (request->from < 0) { - printf("- from: %ld.\n",request->from); + printf("- from: %ld.\n",(long) request->from); } else { if (edg_wll_ULMTimevalToDate(request->from,0,date) != 0) { fprintf(stderr,"Error parsing 'from' argument.\n"); goto main_end; } - printf("- from: %ld (i.e. %s).\n",request->from,date); + printf("- from: %ld (i.e. %s).\n",(long) request->from,date); } if (request->to < 0) { - printf("- to: %ld.\n",request->to); + printf("- to: %ld.\n",(long) request->to); } else { if (edg_wll_ULMTimevalToDate(request->to,0,date) != 0) { fprintf(stderr,"Error parsing 'to' argument.\n"); goto main_end; } - printf("- to: %ld (i.e. %s).\n",request->to,date); + printf("- to: %ld (i.e. %s).\n",(long) request->to,date); } } @@ -160,12 +160,12 @@ int main(int argc,char *argv[]) fprintf(stderr,"Error parsing 'from' argument.\n"); goto main_end; } - printf("- from: %ld (i.e. %s).\n",result->from,date); + printf("- from: %ld (i.e. %s).\n",(long) result->from,date); if (edg_wll_ULMTimevalToDate(result->to,0,date) != 0) { fprintf(stderr,"Error parsing 'to' argument.\n"); goto main_end; } - printf("- to: %ld (i.e. %s).\n",result->to,date); + printf("- to: %ld (i.e. %s).\n",(long) result->to,date); main_end: dprintf(("End.\n")); diff --git a/org.glite.lb.client/src/lb_dump_exporter.c b/org.glite.lb.client/src/lb_dump_exporter.c index 40bef29..ce74d36 100644 --- a/org.glite.lb.client/src/lb_dump_exporter.c +++ b/org.glite.lb.client/src/lb_dump_exporter.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include "glite/lb/context.h" @@ -158,7 +157,7 @@ int main(int argc, char **argv) perror("Can't create dump file - max tries limit reached "); cleanup(1); } - snprintf(fname, PATH_MAX, "%s/%s.%ld", store_pref, unique, time(NULL)); + snprintf(fname, PATH_MAX, "%s/%s.%ld", store_pref, unique, (long) time(NULL)); if ( (fd = open(fname, O_CREAT|O_EXCL|O_RDWR, 00600)) < 0 ) { if ( errno == EEXIST ) { sleep(2); continue; } perror(fname); @@ -200,7 +199,8 @@ int main(int argc, char **argv) cleanup(1); } if ( jpps ) - sprintf(msg, "%s%s\n%s%s%s%s%s", + /* XXX: used to be 5x %s here, God knows why ... */ + sprintf(msg, "%s%s\n%s%s%s%s", KEYNAME_JOBID, st->job, KEYNAME_FILE, st->fname, KEYNAME_JPPS, jpps); else sprintf(msg, "%s%s\n%s%s", -- 1.8.2.3