diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-01-21 09:56:34 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-01-21 09:56:34 +0000 |
commit | 4d9475e4ef71951d60120746f8bb130d3918f015 (patch) | |
tree | a9de685aba075743c570f46a7bd67a6aa9a8e26e /epan/tvbuff.c | |
parent | 35d0d0f1ae67528f1f2f7f23651b498178f7143a (diff) |
Get rid of tvb_get_faked_unicode() - tvb_get_string_enc() does the job
better.
We don't need eventlog_get_unicode_string_length() in the eventlog
dissector, either - tvb_unicode_strsize() does the job just as well.
svn path=/trunk/; revision=54874
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r-- | epan/tvbuff.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index e9d23a5302..a0371a7423 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -1741,43 +1741,6 @@ tvb_memeql(tvbuff_t *tvb, const gint offset, const guint8 *str, size_t size) } } -/* Convert a string from Unicode to ASCII. At the moment we fake it by - * replacing all non-ASCII characters with a '.' )-: The len parameter is - * the number of guint16's to convert from Unicode. - * - * If scope is set to NULL, returned buffer is allocated by g_malloc() - * and must be g_free by the caller. Otherwise memory is automatically - * freed when the scope lifetime is reached. - */ -/* XXX: This has been replaced by tvb_get_string() */ -char * -tvb_get_faked_unicode(wmem_allocator_t *scope, tvbuff_t *tvb, int offset, - const int len, const gboolean little_endian) -{ - char *buffer; - int i; - guint16 character; - - /* Make sure we have enough data before allocating the buffer, - so we don't blow up if the length is huge. */ - tvb_ensure_bytes_exist(tvb, offset, 2*len); - - /* We know we won't throw an exception, so we don't have to worry - about leaking this buffer. */ - buffer = (char *)wmem_alloc(scope, len + 1); - - for (i = 0; i < len; i++) { - character = little_endian ? tvb_get_letohs(tvb, offset) - : tvb_get_ntohs(tvb, offset); - buffer[i] = character < 256 ? character : '.'; - offset += 2; - } - - buffer[len] = 0; - - return buffer; -} - /* * Format the data in the tvb from offset for length ... */ |