This is the relevant snip of my code:
tmp = headptr;
//some other stuff
logsize += (sizeof(log_t) + strleng(tmp->item.string) + 4);
*log = (char*)malloc(sizeof(logsize));
log is declared as
char *log, so dereferencing log i.e.
*log makes it a char. The return from malloc is a pointer. So, when you assign it to *log, the compiler says you are trying to make an integer from a pointer which is correct.
But, based on your question and details in it, looks like there are other mistakes too. For Ex: you are trying to pass
sizeof(logsize) which will yield only the size of the size_t. I guess you want a memory block equivalent to
logsize and not
You have also mentioned that you are having a
char *string in your structure, in which you should be allocating memory for it seperately.
So, for now, looks like you will have to modify your statement as:
log = malloc(logsize);