Re:Why Does Software Rot?
by kazinator on Saturday June 25, 2016 @01:32PM
(#11977130)
strncpy is strcpy's daft cousin that wastefully writes extra null characters---except when there is no room; then it neglects to null-terminate at all.
strncpy was not needed even in C90, because of sprintf, which is less clumsy to use, doing everything in one step:
strncpy was not needed even in C90, because of sprintf, which is less clumsy to use, doing everything in one step:
If we replace the 63 with * , we can pass a dynamic size: