summaryrefslogtreecommitdiff
path: root/lib/progress.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-03-02 09:31:18 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-03-02 09:31:18 +0000
commit353f7641193ddf3f6a42d49d53ea994e4ea4388b (patch)
tree17927ce646b5331cedef8a05b819d5869ad983be /lib/progress.c
parent9f437269fb0b8ccb3311da268e985fea122bc8b8 (diff)
downloadcurl-353f7641193ddf3f6a42d49d53ea994e4ea4388b.tar.gz
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'.
Diffstat (limited to 'lib/progress.c')
-rw-r--r--lib/progress.c10
1 files changed, 5 insertions, 5 deletions
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,