summaryrefslogtreecommitdiff
path: root/wsutil/str_util.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2013-07-01 15:41:05 +0000
committerBill Meier <wmeier@newsguy.com>2013-07-01 15:41:05 +0000
commit828d4e89f64e397b922ff74d70783554a29f7671 (patch)
tree3ba01f877931aa2cfa113d03e7b597c8ce7f038e /wsutil/str_util.c
parent7b5a0e4a153659551c4f57f225355c4e8504f9b5 (diff)
downloadwireshark-828d4e89f64e397b922ff74d70783554a29f7671.tar.gz
Define certain 'const char *...' arrays as static.
(That is: Don't create the array on the stack each time the function is called). Reduces code memory usage and execution time. (See SVN #50271) svn path=/trunk/; revision=50300
Diffstat (limited to 'wsutil/str_util.c')
-rw-r--r--wsutil/str_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wsutil/str_util.c b/wsutil/str_util.c
index c754423536..9c0aa6e802 100644
--- a/wsutil/str_util.c
+++ b/wsutil/str_util.c
@@ -104,7 +104,7 @@ gchar *format_size(gint64 size, format_size_flags_e flags) {
int power = 1000;
int pfx_off = 0;
gboolean is_small = FALSE;
- const gchar *prefix[] = {"T", "G", "M", "k", "Ti", "Gi", "Mi", "Ki"};
+ static const gchar *prefix[] = {"T", "G", "M", "k", "Ti", "Gi", "Mi", "Ki"};
gchar *ret_val;
if ((flags & FORMAT_SIZE_PFX_MASK) == format_size_prefix_iec) {