aboutsummaryrefslogtreecommitdiffstats
path: root/epan/strutil.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-17 09:36:20 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-17 09:36:20 +0000
commit72b425a223941e01f423258bbd94cc7e86016fda (patch)
treebc53492d18a339c583153f54957c4d9c736ae3be /epan/strutil.c
parent6a2428bb5978d43b856b3934e3c3899b0b1e8700 (diff)
replace some more silly rotating buffers with ep_alloc() calls
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15386 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/strutil.c')
-rw-r--r--epan/strutil.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/epan/strutil.c b/epan/strutil.c
index 2a122d44c6..bba8e19651 100644
--- a/epan/strutil.c
+++ b/epan/strutil.c
@@ -31,6 +31,7 @@
#include <ctype.h>
#include <glib.h>
#include "strutil.h"
+#include "emem.h"
/*
@@ -274,18 +275,13 @@ bytes_to_str(const guint8 *bd, int bd_len) {
*/
gchar *
bytes_to_str_punct(const guint8 *bd, int bd_len, gchar punct) {
- static gchar str[N_BYTES_TO_STR_STRINGS][MAX_BYTE_STR_LEN+3+1];
- static int cur_idx;
gchar *cur;
gchar *p;
int len;
static const char hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
- cur_idx++;
- if (cur_idx >= N_BYTES_TO_STR_STRINGS)
- cur_idx = 0;
- cur = &str[cur_idx][0];
+ cur=ep_alloc(MAX_BYTE_STR_LEN+3+1);
p = cur;
len = MAX_BYTE_STR_LEN;
while (bd_len > 0 && len > 0) {