64 characters isn't enough. Make it 2048 and use snprintf and strncpy to avoid buffer overflow, and don't forget to null terminate the buffer afterward in case they fail.