aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-08-24 01:56:36 -0700
committerGuy Harris <guy@alum.mit.edu>2014-08-24 08:57:13 +0000
commitcda5c166674485f77435d1e95d482852a83c142d (patch)
treeb951d9fd8d5b87c033460243ddd1398a94d855d7 /wsutil
parenta52939cef2188f5de8964923a9f142224a421316 (diff)
Clean up capinfos output.
Make sure there's always a space between a number and "[TGMK]bytes", "[TGMK]bits", and "[TGMK]packets". Change-Id: I710385303e451e9aea6fc9bbea562f59ca0d22c9 Reviewed-on: https://code.wireshark.org/review/3810 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/str_util.c14
-rw-r--r--wsutil/str_util.h12
2 files changed, 17 insertions, 9 deletions
diff --git a/wsutil/str_util.c b/wsutil/str_util.c
index 696e861ccb..c171edfa6e 100644
--- a/wsutil/str_util.c
+++ b/wsutil/str_util.c
@@ -153,16 +153,22 @@ gchar *format_size(gint64 size, format_size_flags_e flags) {
case format_size_unit_none:
break;
case format_size_unit_bytes:
- g_string_append(human_str, is_small ? "bytes" : "B");
+ g_string_append(human_str, is_small ? " bytes" : "B");
break;
case format_size_unit_bits:
- g_string_append(human_str, is_small ? "bits" : "b");
+ g_string_append(human_str, is_small ? " bits" : "b");
break;
case format_size_unit_bits_s:
- g_string_append(human_str, is_small ? "bits/s" : "bps");
+ g_string_append(human_str, is_small ? " bits/s" : "bps");
break;
case format_size_unit_bytes_s:
- g_string_append(human_str, is_small ? "bytes/s" : "Bps");
+ g_string_append(human_str, is_small ? " bytes/s" : "Bps");
+ break;
+ case format_size_unit_packets:
+ g_string_append(human_str, is_small ? " packets" : "packets");
+ break;
+ case format_size_unit_packets_s:
+ g_string_append(human_str, is_small ? " packets/s" : "packets/s");
break;
default:
g_assert_not_reached();
diff --git a/wsutil/str_util.h b/wsutil/str_util.h
index 04e33c445e..971fa3542d 100644
--- a/wsutil/str_util.h
+++ b/wsutil/str_util.h
@@ -86,11 +86,13 @@ WS_DLL_PUBLIC
int ws_xton(char ch);
typedef enum {
- format_size_unit_none = 0, /**< No unit will be appended. You must supply your own. */
- format_size_unit_bytes = 1, /**< "bytes" for un-prefixed sizes, "B" otherwise. */
- format_size_unit_bits = 2, /**< "bits" for un-prefixed sizes, "b" otherwise. */
- format_size_unit_bits_s = 3, /**< "bits/s" for un-prefixed sizes, "bps" otherwise. */
- format_size_unit_bytes_s = 4, /**< "bytes/s" for un-prefixed sizes, "Bps" otherwise. */
+ format_size_unit_none = 0, /**< No unit will be appended. You must supply your own. */
+ format_size_unit_bytes = 1, /**< "bytes" for un-prefixed sizes, "B" otherwise. */
+ format_size_unit_bits = 2, /**< "bits" for un-prefixed sizes, "b" otherwise. */
+ format_size_unit_bits_s = 3, /**< "bits/s" for un-prefixed sizes, "bps" otherwise. */
+ format_size_unit_bytes_s = 4, /**< "bytes/s" for un-prefixed sizes, "Bps" otherwise. */
+ format_size_unit_packets = 5, /**< "packets" */
+ format_size_unit_packets_s = 6, /**< "packets/s" */
format_size_prefix_si = 0 << 8, /**< SI (power of 1000) prefixes will be used. */
format_size_prefix_iec = 1 << 8 /**< IEC (power of 1024) prefixes will be used. */
/* XXX format_size_prefix_default_for_this_particular_os ? */