From: Frederic Marchal Date: Mon, 31 Mar 2014 18:40:19 +0000 (+0200) Subject: Fix a compile error on 64-bit processors X-Git-Tag: v2.3.9~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88c1c928bdb6324d49146c1d9b775c3a00d1e6e4;p=thirdparty%2Fsarg.git 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. --- 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) {