aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nfs.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-nfs.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-nfs.c')
-rw-r--r--epan/dissectors/packet-nfs.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
index 0a821953d3..16e990f949 100644
--- a/epan/dissectors/packet-nfs.c
+++ b/epan/dissectors/packet-nfs.c
@@ -39,6 +39,7 @@
#include <epan/prefs.h>
#include <epan/packet.h>
#include <epan/emem.h>
+#include <epan/strutil.h>
static int proto_nfs = -1;
@@ -1317,10 +1318,11 @@ dissect_fhandle_data_NETAPP(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *t
flag_string=ep_alloc(512);
flag_string[0]=0;
- while (bit--)
- if (flags & (1<<bit))
- strncat(flag_string, strings[bit], 512 - strlen(flag_string));
- flag_string[512-1] = '\0';
+ while (bit--) {
+ if (flags & (1<<bit)) {
+ g_strlcat(flag_string, strings[bit], 512);
+ }
+ }
item = proto_tree_add_text(tree, tvb, offset + 0, 8,
"mount (inode %u)", mount);
subtree = proto_item_add_subtree(item, ett_nfs_fh_mount);
@@ -1439,10 +1441,9 @@ dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree
while (bit--) {
if (flags & (1<<bit)) {
- strncat(flag_string, strings[bit], 512 - strlen(flag_string));
+ g_strlcat(flag_string, strings[bit], 512);
}
}
- flag_string[512-1] = '\0';
item = proto_tree_add_text(tree, tvb, offset + 0, 8, "export (inode %u)", fileid);
subtree = proto_item_add_subtree(item, ett_nfsv4_fh_export);