summaryrefslogtreecommitdiff
path: root/text2pcap.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2008-05-13 07:26:20 +0000
committerAnders Broman <anders.broman@ericsson.com>2008-05-13 07:26:20 +0000
commita81458155392e7e9717ee305501c13f74fffa467 (patch)
tree0a3e88403a079c17335d9347ea680a234d6fb6d7 /text2pcap.c
parentd22975841b065e71cb4906dc42fb25b36a0ab31d (diff)
downloadwireshark-a81458155392e7e9717ee305501c13f74fffa467.tar.gz
Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25284
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",