summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2011-10-05 22:49:38 +0200
committerGravatar Martin Szulecki2012-03-19 01:45:13 +0100
commit62f16c72e4416acf369640a0dff4960bc3e2c0a5 (patch)
tree743b20f2ee2927599657babf5660b7f4efdc1a0a
parent059de1b310095402597e51c5ac7078ed66ebfbd9 (diff)
downloadlibimobiledevice-62f16c72e4416acf369640a0dff4960bc3e2c0a5.tar.gz
libimobiledevice-62f16c72e4416acf369640a0dff4960bc3e2c0a5.tar.bz2
Fix format_size_for_display for size < 1000
-rw-r--r--tools/idevicebackup.c2
-rw-r--r--tools/idevicebackup2.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c
index d6d9228..159f3b1 100644
--- a/tools/idevicebackup.c
+++ b/tools/idevicebackup.c
@@ -275,6 +275,8 @@ static char* format_size_for_display(uint64_t size)
} else if (size >= 1000LL) {
sz = ((double)size / 1000.0f);
sprintf(buf, "%0.1f kB", sz);
+ } else {
+ sprintf(buf, "%d Bytes", (int)size);
}
return strdup(buf);
}
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index 57c7865..30e3724 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -240,6 +240,8 @@ static char* format_size_for_display(uint64_t size)
} else if (size >= 1000LL) {
sz = ((double)size / 1000.0f);
sprintf(buf, "%0.1f kB", sz);
+ } else {
+ sprintf(buf, "%d Bytes", (int)size);
}
return strdup(buf);
}