Copies characters from the source string to the target buffer until reaching the specified terminating character.