aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/cosine.c
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2008-05-08 05:16:33 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2008-05-08 05:16:33 +0000
commitab645edcd9b172e374b2541c239f013db42da99c (patch)
treeeb5566e364265e2626b7c14b7b6db0b0fb1be441 /wiretap/cosine.c
parenta95decdda0420f0992caed35558d27494e2d8f7d (diff)
strncpy -> g_strlcpy
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25254 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/cosine.c')
-rw-r--r--wiretap/cosine.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/wiretap/cosine.c b/wiretap/cosine.c
index e43dc007d3..1cf77f6c4e 100644
--- a/wiretap/cosine.c
+++ b/wiretap/cosine.c
@@ -218,8 +218,7 @@ static gint64 cosine_seek_next_packet(wtap *wth, int *err, char *hdr)
if (file_gets(buf, sizeof(buf), wth->fh) != NULL) {
if (strstr(buf, COSINE_REC_MAGIC_STR1) ||
strstr(buf, COSINE_REC_MAGIC_STR2)) {
- strncpy(hdr, buf, COSINE_LINE_LENGTH-1);
- hdr[COSINE_LINE_LENGTH-1] = '\0';
+ g_strlcpy(hdr, buf, COSINE_LINE_LENGTH);
return cur_off;
}
} else {
@@ -449,8 +448,8 @@ parse_cosine_rec_hdr(wtap *wth, const char *line,
} else if (strncmp(direction, "l2-rx", 5) == 0) {
pseudo_header->cosine.direction = COSINE_DIR_RX;
}
- strncpy(pseudo_header->cosine.if_name, if_name,
- COSINE_MAX_IF_NAME_LEN - 1);
+ g_strlcpy(pseudo_header->cosine.if_name, if_name,
+ COSINE_MAX_IF_NAME_LEN);
pseudo_header->cosine.pro = pro;
pseudo_header->cosine.off = off;
pseudo_header->cosine.pri = pri;