a malloc will do here I think, no need to calloc? Also, I am seeing "(char*) calloc" and similar quite a few times. Please stick to the coding style: "(char *)calloc".