totuser++;
if (olduser[0] != '\0') {
- fprintf(fp_top2,"%s\t%lld\t%lld\t%lld\t%lld\t%lld\n",olduser,tnbytes,tnacc,tnelap,tnincache,tnoucache);
+ /*
+ This complicated printf is due to Microsoft's inability to comply with any standard. Msvcrt is unable
+ to print a long long int unless it is exactly 64-bits long.
+ */
+ fprintf(fp_top2,"%s\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",olduser,(uint64_t)tnbytes,(uint64_t)tnacc,(uint64_t)tnelap,(uint64_t)tnincache,(uint64_t)tnoucache);
ttnbytes+=tnbytes;
ttnacc+=tnacc;
longline_destroy(&line);
if (olduser[0] != '\0') {
- fprintf(fp_top2,"%s\t%lld\t%lld\t%lld\t%lld\t%lld\n",olduser,tnbytes,tnacc,tnelap,tnincache,tnoucache);
+ /*
+ This complicated printf is due to Microsoft's inability to comply with any standard. Msvcrt is unable
+ to print a long long int unless it is exactly 64-bits long.
+ */
+ fprintf(fp_top2,"%s\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",olduser,(uint64_t)tnbytes,(uint64_t)tnacc,(uint64_t)tnelap,(uint64_t)tnincache,(uint64_t)tnoucache);
ttnbytes+=tnbytes;
ttnacc+=tnacc;
order="";
snprintf(top1,sizeof(top1),"%s/top",outdirname);
- sprintf(csort,"sort -T \"%s\" %s %s -o \"%s\" \"%s\"", TempDir, order, sfield, top1, top2);
+ sprintf(csort,"sort -T \"%s\" %s %s -o \"%s\" \"%s\"", tmp, order, sfield, top1, top2);
cstatus=system(csort);
if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
debuga(_("sort command return status %d\n"),WEXITSTATUS(cstatus));