X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Ftypes%2Fstring.c;fp=formats%2Fctf%2Ftypes%2Fstring.c;h=b648b817aecb4944e462e29c6726a77c918c12cb;hp=b19335e2b860d4418fde30cb0d4526726896e048;hb=8563e754804a60faf870282d494ea419dc87016b;hpb=809cbff588674d09c14b128eb95d332048382770 diff --git a/formats/ctf/types/string.c b/formats/ctf/types/string.c index b19335e2..b648b817 100644 --- a/formats/ctf/types/string.c +++ b/formats/ctf/types/string.c @@ -20,27 +20,6 @@ #include /* C99 limits */ #include -void ctf_string_copy(struct stream_pos *pdest, struct stream_pos *psrc, - const struct declaration_string *string_declaration) -{ - struct ctf_stream_pos *dest = ctf_pos(pdest); - struct ctf_stream_pos *src = ctf_pos(psrc); - size_t len; - char *destaddr, *srcaddr; - - ctf_align_pos(src, string_declaration->p.alignment); - srcaddr = ctf_get_pos_addr(src); - len = strlen(srcaddr) + 1; - if (dest->dummy) - goto end; - ctf_align_pos(dest, string_declaration->p.alignment); - destaddr = ctf_get_pos_addr(dest); - strcpy(destaddr, srcaddr); -end: - ctf_move_pos(dest, len); - ctf_move_pos(src, len); -} - void ctf_string_read(struct stream_pos *ppos, struct definition *definition) { struct definition_string *string_definition = @@ -81,7 +60,7 @@ void ctf_string_write(struct stream_pos *ppos, if (pos->dummy) goto end; destaddr = ctf_get_pos_addr(pos); - strcpy(destaddr, string_definition->value); + memcpy(destaddr, string_definition->value, len); end: ctf_move_pos(pos, len); }