Fix possible buffer overflow using strncat