aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bthci_cmd.c
diff options
context:
space:
mode:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2008-03-01 17:23:39 +0000
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2008-03-01 17:23:39 +0000
commit994d316315868546fa15319311187414c3b4d4f9 (patch)
tree75b52bc6b03f8df488b8acbe97063df9d6d8b02d /epan/dissectors/packet-bthci_cmd.c
parentbb42d82ed760cb028118fca73c79f37e1cbc00b6 (diff)
Rewrote to use g_strlcpy and g_strlcat.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24525 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-bthci_cmd.c')
-rw-r--r--epan/dissectors/packet-bthci_cmd.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/epan/dissectors/packet-bthci_cmd.c b/epan/dissectors/packet-bthci_cmd.c
index 246c390cc6..c090c5ad52 100644
--- a/epan/dissectors/packet-bthci_cmd.c
+++ b/epan/dissectors/packet-bthci_cmd.c
@@ -38,6 +38,7 @@
#include <string.h>
#include <epan/packet.h>
+#include <epan/strutil.h>
#include <etypes.h>
#include <packet-hci_h4.h>
#include <addr_resolv.h>
@@ -834,20 +835,19 @@ dissect_bthci_cmd_cod(int type, tvbuff_t *tvb, int offset, packet_info *pinfo _U
buf[0] = '\0';
proto_item_append_text(item, " (%s - services:", val_to_str(cod1 & 0x1f, bthci_cmd_major_dev_class_vals, "???"));
- if (cod2 & 0x80) strncat(buf, " Information,", sizeof(buf) - strlen(buf));
- if (cod2 & 0x40) strncat(buf, " Telephony,", sizeof(buf) - strlen(buf));
- if (cod2 & 0x20) strncat(buf, " Audio,", sizeof(buf) - strlen(buf));
- if (cod2 & 0x10) strncat(buf, " Object transfer,", sizeof(buf) - strlen(buf));
- if (cod2 & 0x08) strncat(buf, " Capturing,", sizeof(buf) - strlen(buf));
- if (cod2 & 0x04) strncat(buf, " Rendering,", sizeof(buf) - strlen(buf));
- if (cod2 & 0x02) strncat(buf, " Networking,", sizeof(buf) - strlen(buf));
- if (cod2 & 0x01) strncat(buf, " Positioning,", sizeof(buf) - strlen(buf));
- if (cod1 & 0x20) strncat(buf, " Limited discoverable mode,", sizeof(buf) - strlen(buf));
+ if (cod2 & 0x80) g_strlcat(buf, " Information,", sizeof(buf));
+ if (cod2 & 0x40) g_strlcat(buf, " Telephony,", sizeof(buf));
+ if (cod2 & 0x20) g_strlcat(buf, " Audio,", sizeof(buf));
+ if (cod2 & 0x10) g_strlcat(buf, " Object transfer,", sizeof(buf));
+ if (cod2 & 0x08) g_strlcat(buf, " Capturing,", sizeof(buf));
+ if (cod2 & 0x04) g_strlcat(buf, " Rendering,", sizeof(buf));
+ if (cod2 & 0x02) g_strlcat(buf, " Networking,", sizeof(buf));
+ if (cod2 & 0x01) g_strlcat(buf, " Positioning,", sizeof(buf));
+ if (cod1 & 0x20) g_strlcat(buf, " Limited discoverable mode,", sizeof(buf));
buf[strlen(buf)-1] = '\0'; /* skip last comma */
- strncat(buf, ")", sizeof(buf) - strlen(buf));
- buf[128-1] = '\0';
+ g_strlcat(buf, ")", sizeof(buf));
proto_item_append_text(item, buf);
}
else