diff options
author | martinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-07-29 09:39:52 +0000 |
---|---|---|
committer | martinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-07-29 09:39:52 +0000 |
commit | 795a976478f7dfedcdd2f89ec2a877785db14245 (patch) | |
tree | ccaaf7ddc50950f60603d906605d6aaf6ed7fea9 /epan/dissectors | |
parent | 461d9e6e83f40a2325646e715d7669d60171824d (diff) |
Don't use sprintf().
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33668 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-catapult-dct2000.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c index cd06455422..c24b5c28c1 100644 --- a/epan/dissectors/packet-catapult-dct2000.c +++ b/epan/dissectors/packet-catapult-dct2000.c @@ -1536,14 +1536,15 @@ static void dissect_tty_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre int n, idx; char *hex_string; int tty_string_length = tvb_length_remaining(tvb, offset); - hex_string = ep_alloc(1+(2*tty_string_length)+1); + int hex_string_length = 1+(2*tty_string_length)+1; + hex_string = ep_alloc(hex_string_length); - idx = sprintf(hex_string, "$"); + idx = g_snprintf(hex_string, hex_string_length, "$"); /* Write hex out to new string */ for (n=0; n < tty_string_length; n++) { - idx += sprintf(hex_string+idx, "%02x", - tvb_get_guint8(tvb, offset+n)); + idx += g_snprintf(hex_string+idx, 3, "%02x", + tvb_get_guint8(tvb, offset+n)); } string = hex_string; } |