diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-05-08 05:16:33 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-05-08 05:16:33 +0000 |
commit | ab645edcd9b172e374b2541c239f013db42da99c (patch) | |
tree | eb5566e364265e2626b7c14b7b6db0b0fb1be441 /wiretap/cosine.c | |
parent | a95decdda0420f0992caed35558d27494e2d8f7d (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.c | 7 |
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; |