aboutsummaryrefslogtreecommitdiffstats
path: root/text2pcap.c
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2008-05-13 07:26:20 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2008-05-13 07:26:20 +0000
commit330bb2c7819d00d6b484a7bc00473ced75757715 (patch)
tree0a3e88403a079c17335d9347ea680a234d6fb6d7 /text2pcap.c
parent4fae53e13bdc32d7fd76ea6dd589ffc707f47ffc (diff)
Fix some of the Errors/warnings detected by checkapi.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25284 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'text2pcap.c')
-rw-r--r--text2pcap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/text2pcap.c b/text2pcap.c
index 829b205dbc..c62aa7490a 100644
--- a/text2pcap.c
+++ b/text2pcap.c
@@ -704,12 +704,12 @@ append_to_preamble(char *str)
if (toklen != 0) {
if (packet_preamble_len + toklen > PACKET_PREAMBLE_MAX_LEN)
return; /* no room to add the token to the preamble */
- strncpy(&packet_preamble[packet_preamble_len], str, PACKET_PREAMBLE_MAX_LEN - packet_preamble_len);
+ g_strlcpy(&packet_preamble[packet_preamble_len], str, PACKET_PREAMBLE_MAX_LEN);
packet_preamble_len += toklen;
if (debug >= 2) {
char *c;
char xs[PACKET_PREAMBLE_MAX_LEN];
- strncpy(xs, packet_preamble, PACKET_PREAMBLE_MAX_LEN);
+ g_strlcpy(xs, packet_preamble, PACKET_PREAMBLE_MAX_LEN);
while ((c = strchr(xs, '\r')) != NULL) *c=' ';
fprintf (stderr, "[[append_to_preamble: \"%s\"]]", xs);
}
@@ -1263,7 +1263,7 @@ parse_options (int argc, char *argv[])
}
if (strcmp(argv[optind], "-")) {
- input_filename = strdup(argv[optind]);
+ input_filename = g_strdup(argv[optind]);
input_file = eth_fopen(input_filename, "rb");
if (!input_file) {
fprintf(stderr, "Cannot open file [%s] for reading: %s\n",
@@ -1276,7 +1276,7 @@ parse_options (int argc, char *argv[])
}
if (strcmp(argv[optind+1], "-")) {
- output_filename = strdup(argv[optind+1]);
+ output_filename = g_strdup(argv[optind+1]);
output_file = eth_fopen(output_filename, "wb");
if (!output_file) {
fprintf(stderr, "Cannot open file [%s] for writing: %s\n",