diff options
author | Anders Broman <anders.broman@ericsson.com> | 2008-05-08 05:16:33 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2008-05-08 05:16:33 +0000 |
commit | 6d91aae2e1b011b85b7efc02cb385225bf0d0efa (patch) | |
tree | eb5566e364265e2626b7c14b7b6db0b0fb1be441 /wiretap/cosine.c | |
parent | 6ae13430946abfb589ea350265aa9ae8a0ec471a (diff) |
strncpy -> g_strlcpy
svn path=/trunk/; revision=25254
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; |