Usually caused by not malloc() enough space when using strcpy(), Make sure you have enough space in your char*