summaryrefslogtreecommitdiff
path: root/wsutil/str_util.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-10-10 20:19:18 +0000
committerGerald Combs <gerald@wireshark.org>2012-10-10 20:19:18 +0000
commitf003add90f1dbfffb036f989d9f5964d2a3939a9 (patch)
tree8efe84b31a40ddfacc95a4e1c43c98745c4fdebb /wsutil/str_util.c
parent5ba1ad12cc92c5d8e87d8ff4edb5767d4cf63d64 (diff)
downloadwireshark-f003add90f1dbfffb036f989d9f5964d2a3939a9.tar.gz
Fix a copy+paste error and a missing include. Adjust the format_size
digit threshold. svn path=/trunk/; revision=45456
Diffstat (limited to 'wsutil/str_util.c')
-rw-r--r--wsutil/str_util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/wsutil/str_util.c b/wsutil/str_util.c
index 536fb18355..2bd7041fb6 100644
--- a/wsutil/str_util.c
+++ b/wsutil/str_util.c
@@ -106,13 +106,13 @@ gchar *format_size(gint64 size, format_size_flags_e flags) {
power = 1024;
}
- if (size / power / power / power / power > 10) {
+ if (size / power / power / power / power >= 10) {
g_string_printf(human_str, "%" G_GINT64_MODIFIER "d %s", size / power / power / power / power, prefix[pfx_off]);
- } else if (size / power / power / power > 10) {
+ } else if (size / power / power / power >= 10) {
g_string_printf(human_str, "%" G_GINT64_MODIFIER "d %s", size / power / power / power, prefix[pfx_off+1]);
- } else if (size / power / power > 10) {
+ } else if (size / power / power >= 10) {
g_string_printf(human_str, "%" G_GINT64_MODIFIER "d %s", size / power / power, prefix[pfx_off+2]);
- } else if (size / power > 10) {
+ } else if (size / power >= 10) {
g_string_printf(human_str, "%" G_GINT64_MODIFIER "d %s", size / power, prefix[pfx_off+3]);
} else {
g_string_printf(human_str, "%" G_GINT64_MODIFIER "d ", size);