From 88c1c928bdb6324d49146c1d9b775c3a00d1e6e4 Mon Sep 17 00:00:00 2001 From: Frederic Marchal Date: Mon, 31 Mar 2014 20:40:19 +0200 Subject: [PATCH] Fix a compile error on 64-bit processors A long long int must be cast to a int64_t before being formatted to a PRIi64 in a printf-like function. --- log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/log.c b/log.c index c2a13a1..de08ac8 100644 --- a/log.c +++ b/log.c @@ -1503,14 +1503,14 @@ int main(int argc,char *argv[]) } } - if (fprintf(ufile->file, "%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,ip,url,nbytes,code,elap_time,smartfilter)<=0) { + if (fprintf(ufile->file, "%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,ip,url,(int64_t)nbytes,code,elap_time,smartfilter)<=0) { debuga(_("Write error in the log file of user %s\n"),user); exit(EXIT_FAILURE); } records_kept++; if(fp_log && ilf!=ILF_Sarg) - fprintf(fp_log, "%s\t%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,user,ip,url,nbytes,code,elap_time,smartfilter); + fprintf(fp_log, "%s\t%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,user,ip,url,(int64_t)nbytes,code,elap_time,smartfilter); totregsg++; @@ -1561,7 +1561,7 @@ int main(int argc,char *argv[]) printf("FUNC=\t%s\n",fun); printf("URL=\t%s\n",url); printf("CODE=\t%s\n",code); - printf("LEN=\t%"PRIi64"\n",nbytes); + printf("LEN=\t%"PRIi64"\n",(int64_t)nbytes); } } if (!from_stdin) { -- 2.47.2