Why does strcpy(3) (and strncpy(3)) return their first argument? I don't see how this does add any value. Instead, frequently I'd rather have the number of copied bytes returned.
Addendum: What am I supposed to do when I need also the length of the resulting string? Do I really have to implement my own version?
strcpy()returned a pointer to the'\0'byte at the end of the string. However, if you length check everything before you do your copying (as you should to be safe), you can usememmove()(or maybememcpy()) instead ofstrcpy(). It's only when you don't have a length available that can't use those, but it is arguably not safe to do the copying if you don't know the lengths of the source string and the target buffer.stpcpy(3).mempcpy(3).; the same with better return value