mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-23 14:59:47 +03:00
C89
svn path=/trunk/netsurf/; revision=4795
This commit is contained in:
parent
34e0f4db3f
commit
4c6006e6f4
@ -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++;
|
||||
|
@ -172,6 +172,8 @@ 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;
|
||||
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user