News for hackers. Stuff that matters.
Re:Considering C99 for Curl by cesarb on Tuesday November 22, 2022 @12:15PM (#33708163)
The output side of strncpy() might not be a str___() function, but AFAICS the input side of strncpy() is clearly a str___() function, since it stops reading (but not writing) at the first NUL byte.
Re:Considering C99 for Curl by masklinn on Tuesday November 22, 2022 @12:21PM (#33708255)
It’s incidental more than purposeful, though it does have its use as a conversion function: with a nul-padded field, why would you keep copying once you’ve hit the first nul? You can just set from an immediate without the need to read from memory.