So there is a problem I am headbanging over two nights in a row:
(tuple1 and tuple2 are void pointers passed to this function)
char *data;
data = (char*
Begin your experiment with something smaller, which is easier to debug:
void* tuple1 = calloc(2, 1);
char* content1 = "ab";
memcpy(tuple1, content1, 2);
void* tuple2 = calloc(4, 1);
char* content2 = "cdef";;
memcpy(tuple2, content2, 4);
char *data = data = (char*) calloc (6, 1);
memcpy(data, tuple1, 2);
memcpy(data+2, tuple2, 4);
printf("%.*s\n", 6, data); // should print: abcdef