|
|
|
|
|
by WalterBright
2046 days ago
|
|
Every time I review code and see strncpy, I look closer because it's always used incorrectly. It's always about the terminating 0. Is the 0 there or not? Is the 0 part of n or not? Does the destination have to be n+1 in size for the 0? I quit using it myself because I could never remember just what the exact protocol was for 0. |
|