From 353f7641193ddf3f6a42d49d53ea994e4ea4388b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Mar 2004 09:31:18 +0000 Subject: Yet another curl_off_t printf format attempt, we now exclude the %-letter from FORMAT_OFF_T to allow additional options to get specified, like with '"%5" FORMAT_OFF_T'. --- lib/progress.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/progress.c') diff --git a/lib/progress.c b/lib/progress.c index f7e507685..62e4624f5 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -60,11 +60,11 @@ static char *max5data(double bytes, char *max5) #define ONE_GIGABYTE (1024*1024*1024) if(bytes < 100000) { - sprintf(max5, "%5Od", (curl_off_t)bytes); + sprintf(max5, "%5" FORMAT_OFF_T, (curl_off_t)bytes); return max5; } if(bytes < (10000*ONE_KILOBYTE)) { - sprintf(max5, "%4Odk", (curl_off_t)bytes/ONE_KILOBYTE); + sprintf(max5, "%4" FORMAT_OFF_T "k", (curl_off_t)bytes/ONE_KILOBYTE); return max5; } if(bytes < (100*ONE_MEGABYTE)) { @@ -74,13 +74,13 @@ static char *max5data(double bytes, char *max5) } #if SIZEOF_CURL_OFF_T > 4 if((curl_off_t)bytes < ((curl_off_t)10000*ONE_MEGABYTE)) { - sprintf(max5, "%4OdM", (curl_off_t)bytes/ONE_MEGABYTE); + sprintf(max5, "%4" FORMAT_OFF_T "M", (curl_off_t)bytes/ONE_MEGABYTE); return max5; } /* 10000 MB - 8589934587 GB !! */ sprintf(max5, "%4.1fG", bytes/ONE_GIGABYTE); #else - sprintf(max5, "%4OdM", (curl_off_t)bytes/ONE_MEGABYTE); + sprintf(max5, "%4" FORMAT_OFF_T "M", (curl_off_t)bytes/ONE_MEGABYTE); #endif return max5; @@ -240,7 +240,7 @@ int Curl_pgrsUpdate(struct connectdata *conn) if (!data->progress.callback) { if(conn->resume_from) fprintf(data->set.err, - "** Resuming transfer from byte position " FORMAT_OFF_T + "** Resuming transfer from byte position %" FORMAT_OFF_T "\n", conn->resume_from); fprintf(data->set.err, -- cgit v1.2.1