aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-catapult-dct2000.c
diff options
context:
space:
mode:
authormartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>2010-07-29 09:39:52 +0000
committermartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>2010-07-29 09:39:52 +0000
commit795a976478f7dfedcdd2f89ec2a877785db14245 (patch)
treeccaaf7ddc50950f60603d906605d6aaf6ed7fea9 /epan/dissectors/packet-catapult-dct2000.c
parent461d9e6e83f40a2325646e715d7669d60171824d (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/packet-catapult-dct2000.c')
-rw-r--r--epan/dissectors/packet-catapult-dct2000.c9
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;
}