2. return ENAMETOOLONG instead of ENOMEM if name is too long to fit. 3. only decrement cp if we are pointing to the end of the string. [this fixes the cp truncation of the last char problem reported]