Use "format_text()" when setting the display representation of string
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 28 Apr 2002 22:21:09 +0000 (22:21 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 28 Apr 2002 22:21:09 +0000 (22:21 +0000)
values, so that non-printable characters are shown as escapes.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5280 f5534014-38df-0310-8fa8-9805f1628bb7

epan/proto.c

index 9b88b71bf1e832b6e6397bb5822005168bc991e2..80fb1ad7a6dcd782939c54d2c99cd85798dc4ba9 100644 (file)
@@ -1,7 +1,7 @@
 /* proto.c
  * Routines for protocol tree
  *
- * $Id: proto.c,v 1.64 2002/04/20 08:07:56 guy Exp $
+ * $Id: proto.c,v 1.65 2002/04/28 22:21:09 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -2262,8 +2262,10 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
                case FT_STRING:
                case FT_STRINGZ:
                case FT_UINT_STRING:
+                       bytes = fvalue_get(fi->value);
                        snprintf(label_str, ITEM_LABEL_LENGTH,
-                               "%s: %s", hfinfo->name, (char*) fvalue_get(fi->value));
+                               "%s: %s", hfinfo->name,
+                               format_text(bytes, strlen(bytes)));
                        break;
 
                default: