strncpy
strncpy
Posted Aug 25, 2022 22:03 UTC (Thu) by tialaramex (subscriber, #21167)In reply to: Ushering out strlcpy() by Sesse
Parent article: Ushering out strlcpy()
But, on the other hand notice the newer APIs are still awful. The language just doesn't give us much to work with by having this terrible string type. I think we might have been better off if C hadn't admitted to a string type at all (ie there are no string functions, and no "" literal syntax) and then presumably C89 might have introduced one but there would have been a war to decide how that works (since C89 mostly codifies popular real world C implementations) and I can't believe that 0-terminated wins such a war, even if Pascal-style (length-prefixed) wins that's a less awful world than our world.
Posted Aug 26, 2022 0:46 UTC (Fri)
by NYKevin (subscriber, #129325)
[Link]
strncpy