summaryrefslogtreecommitdiff
path: root/utils/utils.c
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-07-29 09:34:43 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-07-29 09:34:43 +0000
commit4c6006e6f4d50ed9fadcd21a83afc177fd3f99be (patch)
tree74a5994cc156e41a72d31c20526f5992258ff953 /utils/utils.c
parent34e0f4db3fa7994614e37be9973a7e1ef593b0be (diff)
downloadnetsurf-4c6006e6f4d50ed9fadcd21a83afc177fd3f99be.tar.gz
netsurf-4c6006e6f4d50ed9fadcd21a83afc177fd3f99be.tar.bz2
C89
svn path=/trunk/netsurf/; revision=4795
Diffstat (limited to 'utils/utils.c')
-rw-r--r--utils/utils.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/utils.c b/utils/utils.c
index e9e397400..c28bcade7 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -172,8 +172,10 @@ char *human_friendly_bytesize(unsigned long bsize) {
static char buffer2[BYTESIZE_BUFFER_SIZE];
static char buffer3[BYTESIZE_BUFFER_SIZE];
static char *curbuffer = buffer3;
+ enum {bytes, kilobytes, megabytes, gigabytes} unit = bytes;
+ static char units[][7] = {"Bytes", "kBytes", "MBytes", "GBytes"};
- float bytesize = (float)bsize;
+ float bytesize = (float)bsize;
if (curbuffer == buffer1)
curbuffer = buffer2;
@@ -182,9 +184,6 @@ char *human_friendly_bytesize(unsigned long bsize) {
else
curbuffer = buffer1;
- enum {bytes, kilobytes, megabytes, gigabytes} unit = bytes;
- static char units[][7] = {"Bytes", "kBytes", "MBytes", "GBytes"};
-
if (bytesize > 1024) {
bytesize /= 1024;
unit = kilobytes;