All I notice (besides the bad spacing and extra seimicolons after end-braces) is that you should initially zero-terminate dbuf (*dbuf = 0) for use with strcat.
Why are you mallocing 10MB for dbuf when you know it needs to be strlen(fbuffer)+1 long?
You should move
in = j * 16outside of the for i loop since it doesn't need to be set every time. And it doesn't need the if(j>0) protection.
The for i loop can be replaced by strncpy
strncpy(ctext, fbuffer + in, 16);
ctext = 0;
Actually, using strcat to add text to the end of dbuf is wasteful since you know it's being added in 16 char increments.
strncpy(dbuf + in, ptext, 16);
But to fix the bug you mention you probably have to post more code.