diff options
Diffstat (limited to 'utils')
-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; |