summaryrefslogtreecommitdiffstats
path: root/fb-helper.c
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-12-10 18:01:42 +0100
committerFlorian Pritz <bluewind@xinu.at>2011-12-10 18:01:42 +0100
commit6d56af6deeeb8f2cdfdb52952a5179c2e5bc92be (patch)
tree8369ef0405c93c41121397890829bf1777ccccec /fb-helper.c
parente6d8dbf54254458337738768a9bdf5e044b22547 (diff)
remove magic constant
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb-helper.c')
-rw-r--r--fb-helper.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fb-helper.c b/fb-helper.c
index 33d01e7..0c816a1 100644
--- a/fb-helper.c
+++ b/fb-helper.c
@@ -24,6 +24,7 @@
#include <curl/easy.h>
#define FORMAT_ARRAY_SIZE 5
+#define FORMAT_BYTES_BUFFER 64
/* struct which holds the persistent data for progress_callback */
struct progressData {
@@ -77,9 +78,9 @@ void format_bytes(double bytes, char *buf)
// don't print decimals for bytes
if (suffix_pos != 0)
- snprintf(buf, 64, "%.2f%s", size, suffix[suffix_pos]);
+ snprintf(buf, FORMAT_BYTES_BUFFER, "%.2f%s", size, suffix[suffix_pos]);
else
- snprintf(buf, 64, "%.0f%s", size, suffix[suffix_pos]);
+ snprintf(buf, FORMAT_BYTES_BUFFER, "%.0f%s", size, suffix[suffix_pos]);
}
@@ -92,8 +93,8 @@ int progress_callback(
struct progressData *data = (struct progressData *)cb_data;
double timeSpent = 0;
int printed = 0;
- char speed[64];
- char total[64];
+ char speed[FORMAT_BYTES_BUFFER];
+ char total[FORMAT_BYTES_BUFFER];
if (0 == ulnow)
return 0;