- casts to avoid warnings
authorAleš Křenek <ljocha@ics.muni.cz>
Mon, 10 Oct 2005 19:36:58 +0000 (19:36 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Mon, 10 Oct 2005 19:36:58 +0000 (19:36 +0000)
- bad printf format string

org.glite.lb.client/src/dump.c
org.glite.lb.client/src/lb_dump_exporter.c

index f172192..8459199 100644 (file)
@@ -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"));
index 40bef29..ce74d36 100644 (file)
@@ -8,7 +8,6 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <time.h>
-#include <malloc.h>
 #include <limits.h>
 
 #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",