epan: Use UTF8 horizontal ellipsis to indicate truncation
authorStig Bjørlykke <stig@bjorlykke.org>
Sun, 26 Aug 2018 11:48:08 +0000 (13:48 +0200)
committerStig Bjørlykke <stig@bjorlykke.org>
Mon, 27 Aug 2018 08:07:11 +0000 (08:07 +0000)
Use UTF8_HORIZONTAL_ELLIPSIS to indicate string truncation in
bytestring_to_str() and bytes_to_str().

We also use UTF8_HORIZONTAL_ELLIPSIS in the Packet List.

Change-Id: Iaf5c2de97fa71369a8f29ac65fa81f71ed814752
Reviewed-on: https://code.wireshark.org/review/29291
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
epan/to_str.c

index eaa8b287934d22c00a71b28b0c7ad18f00cd84e1..dd8ada4d8a91ac4ee901d5405a77d2bdc898ed20 100644 (file)
@@ -21,6 +21,7 @@
 #include "to_str-int.h"
 #include "strutil.h"
 #include <wsutil/pint.h>
+#include <wsutil/utf8_entities.h>
 
 /*
  * If a user _does_ pass in a too-small buffer, this is probably
@@ -206,7 +207,7 @@ bytestring_to_str(wmem_allocator_t *scope, const guint8 *ad, const guint32 len,
 
        if (truncated) {
                *buf_ptr++ = punct;                     /* 1 byte */
-               buf_ptr    = g_stpcpy(buf_ptr, "...");  /* 3 bytes */
+               buf_ptr    = g_stpcpy(buf_ptr, UTF8_HORIZONTAL_ELLIPSIS);       /* 3 bytes */
        }
 
        *buf_ptr = '\0';
@@ -234,7 +235,7 @@ bytes_to_str(wmem_allocator_t *scope, const guint8 *bd, int bd_len)
        cur_ptr = bytes_to_hexstr(cur, bd, bd_len);     /* max MAX_BYTE_STR_LEN bytes */
 
        if (truncated)
-               cur_ptr = g_stpcpy(cur_ptr, "...");     /* 3 bytes */
+               cur_ptr = g_stpcpy(cur_ptr, UTF8_HORIZONTAL_ELLIPSIS);  /* 3 bytes */
 
        *cur_ptr = '\0';                                /* 1 byte */
        return cur;