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=6a478abfd202072f3a022b068ff49db40c607d61;hp=b648b817aecb4944e462e29c6726a77c918c12cb;hb=847bf71a4af4770390a59e8ef8e1fdfca33687b9;hpb=463b02a3703120da9580609acff5b80987306766 diff --git a/formats/ctf/types/string.c b/formats/ctf/types/string.c index b648b817..6a478abf 100644 --- a/formats/ctf/types/string.c +++ b/formats/ctf/types/string.c @@ -16,6 +16,7 @@ * all copies or substantial portions of the Software. */ +#include #include #include /* C99 limits */ #include @@ -38,9 +39,10 @@ void ctf_string_read(struct stream_pos *ppos, struct definition *definition) g_realloc(string_definition->value, len); string_definition->alloc_len = len; } + printf_debug("CTF string read %s\n", srcaddr); memcpy(string_definition->value, srcaddr, len); string_definition->len = len; - ctf_move_pos(pos, len); + ctf_move_pos(pos, len * CHAR_BIT); } void ctf_string_write(struct stream_pos *ppos, @@ -62,5 +64,5 @@ void ctf_string_write(struct stream_pos *ppos, destaddr = ctf_get_pos_addr(pos); memcpy(destaddr, string_definition->value, len); end: - ctf_move_pos(pos, len); + ctf_move_pos(pos, len * CHAR_BIT); }