Minor changes around display of time and byte counts

This commit is contained in:
Thomas Schmitt 2008-08-07 11:26:37 +00:00
parent 93034c9d81
commit 40f3c3c9e7
2 changed files with 22 additions and 13 deletions

View File

@ -401,9 +401,16 @@ int Sfile_scale(double value, char *result, int siz, double thresh, int flag)
bit2= no fraction (if it would fit at all)
*/
{
char scale_c,scales[6],form[80];
char scale_c,scales[6],form[80], *negpt= NULL, *cpt;
int i,dec_siz= 0,avail_siz= 1;
if(value<0) {
value= -value;
siz--;
result[0]= '-';
negpt= result;
result++;
}
strcpy(scales,"bkmgtp");
scale_c= scales[0];
for(i=1;scales[i]!=0;i++) {
@ -434,6 +441,13 @@ int Sfile_scale(double value, char *result, int siz, double thresh, int flag)
sprintf(form,"%%%d.f%%c",siz-1);
sprintf(result,form,value,scale_c);
}
if(negpt != NULL) {
for(cpt= result; *cpt==' '; cpt++);
if(cpt > result) {
*negpt= ' ';
*(cpt - 1)= '-';
}
}
return(1);
}
@ -1339,7 +1353,7 @@ char *Ftimetxt(time_t t, char timetext[40], int flag)
sprintf(rpt+strlen(rpt), "%12.f", (double) t);
else if (form==1)
sprintf(rpt+strlen(rpt), "%4.4d.%2.2d.%2.2d.%2.2d%2.2d%2.2d",
1900+tms.tm_year, tms.tm_mon, tms.tm_mday,
1900+tms.tm_year, tms.tm_mon+1, tms.tm_mday,
tms.tm_hour, tms.tm_min, tms.tm_sec);
else if (form==2)
sprintf(rpt+strlen(rpt), "%s %s %2.2d %2.2d:%2.2d:%2.2d %4.4d",
@ -12777,17 +12791,12 @@ next_command:;
ret= Xorriso_option_temp_mem_limit(xorriso, arg1, 0);
} else if(strcmp(cmd,"test")==0) { /* This option does not exist. */
char buf[SfileadrL];
time_t t;
(*idx)+= 1;
ret= Xorriso_libburn_adr(xorriso, arg1, buf, 0);
if(ret>0)
sprintf(xorriso->info_text, " %s -> %s\n", arg1, buf);
else if(ret==0)
sprintf(xorriso->info_text, " not a libburn drive: %s\n", arg1);
else
sprintf(xorriso->info_text, " severe error with: %s\n", arg1);
Xorriso_info(xorriso, 0);
(*idx)++;
Decode_timestring(arg1, &t, 0);
sprintf(xorriso->result_line, "%.f\n", (double) t);
Xorriso_result(xorriso, 0);
} else if(strcmp(cmd,"toc")==0) {
Xorriso_option_toc(xorriso, 0);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.08.06.143922"
#define Xorriso_timestamP "2008.08.07.112529"