diff options
author | Anders Broman <anders.broman@ericsson.com> | 2010-02-23 19:28:38 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2010-02-23 19:28:38 +0000 |
commit | 4e66c899d131f58d04563f197a3d5aa2bc3ad760 (patch) | |
tree | e548d193b8418f9e45b8b4c4523c1b702068062f /epan/strutil.c | |
parent | 1d5c24d0682732d796def7be6506019c09936b38 (diff) | |
download | wireshark-4e66c899d131f58d04563f197a3d5aa2bc3ad760.tar.gz |
From Jakub Zawadzki:
Optimizations.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4303
svn path=/trunk/; revision=31967
Diffstat (limited to 'epan/strutil.c')
-rw-r--r-- | epan/strutil.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/epan/strutil.c b/epan/strutil.c index eebbff38ed..ab0019cf8a 100644 --- a/epan/strutil.c +++ b/epan/strutil.c @@ -370,49 +370,6 @@ format_text_wsp(const guchar *string, size_t len) return fmtbuf[idx]; } -/* Max string length for displaying byte string. */ -#define MAX_BYTE_STR_LEN 48 - -/* Turn an array of bytes into a string showing the bytes in hex. */ -#define N_BYTES_TO_STR_STRINGS 6 -gchar * -bytes_to_str(const guint8 *bd, int bd_len) { - return bytes_to_str_punct(bd,bd_len,'\0'); -} - -/* Turn an array of bytes into a string showing the bytes in hex with - * punct as a bytes separator. - */ -gchar * -bytes_to_str_punct(const guint8 *bd, int bd_len, gchar punct) { - gchar *cur; - gchar *p; - int len; - - cur=ep_alloc(MAX_BYTE_STR_LEN+3+1); - p = cur; - len = MAX_BYTE_STR_LEN; - while (bd_len > 0 && len > 0) { - *p++ = hex[(*bd) >> 4]; - *p++ = hex[(*bd) & 0xF]; - len -= 2; - bd++; - bd_len--; - if(punct && bd_len > 0){ - *p++ = punct; - len--; - } - } - if (bd_len != 0) { - /* Note that we're not showing the full string. */ - *p++ = '.'; - *p++ = '.'; - *p++ = '.'; - } - *p = '\0'; - return cur; -} - static gboolean is_byte_sep(guint8 c) { |