diff options
author | François Revel <mmu_man@netsurf-browser.org> | 2008-07-29 09:34:43 +0000 |
---|---|---|
committer | François Revel <mmu_man@netsurf-browser.org> | 2008-07-29 09:34:43 +0000 |
commit | 4c6006e6f4d50ed9fadcd21a83afc177fd3f99be (patch) | |
tree | 74a5994cc156e41a72d31c20526f5992258ff953 | |
parent | 34e0f4db3fa7994614e37be9973a7e1ef593b0be (diff) | |
download | netsurf-4c6006e6f4d50ed9fadcd21a83afc177fd3f99be.tar.gz netsurf-4c6006e6f4d50ed9fadcd21a83afc177fd3f99be.tar.bz2 |
C89
svn path=/trunk/netsurf/; revision=4795
-rw-r--r-- | utils/filename.c | 3 | ||||
-rw-r--r-- | utils/utils.c | 7 |
2 files changed, 5 insertions, 5 deletions
diff --git a/utils/filename.c b/utils/filename.c index 525c95287..55a0aea6a 100644 --- a/utils/filename.c +++ b/utils/filename.c @@ -362,6 +362,7 @@ static struct directory *filename_create_directory(const char *prefix) { int index; struct directory *old_dir, *new_dir, *prev_dir = NULL; char dir_prefix[16]; + int i; /* get the lowest unique prefix, or use the provided one */ if (!prefix) { @@ -433,7 +434,7 @@ static struct directory *filename_create_directory(const char *prefix) { TEMP_FILENAME_PREFIX); last_1 = filename_directory + strlen(TEMP_FILENAME_PREFIX) + 1; last_2 = new_dir->prefix; - for (int i = 0; i < 3 && *last_2; i++) { + for (i = 0; i < 3 && *last_2; i++) { *last_1++ = *last_2++; while (*last_2 && *last_2 != '/') *last_1++ = *last_2++; 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; |