From 72b425a223941e01f423258bbd94cc7e86016fda Mon Sep 17 00:00:00 2001 From: sahlberg Date: Wed, 17 Aug 2005 09:36:20 +0000 Subject: 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 --- epan/strutil.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'epan/strutil.c') 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 #include #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) { -- cgit v1.2.3