Ushering out strlcpy()
Ushering out strlcpy()
Posted Aug 25, 2022 16:23 UTC (Thu) by IanKelling (subscriber, #89418)Parent article: Ushering out strlcpy()
Funny.
Posted Aug 25, 2022 18:08 UTC (Thu)
by adobriyan (subscriber, #30858)
[Link] (3 responses)
Posted Aug 25, 2022 19:47 UTC (Thu)
by Sesse (subscriber, #53779)
[Link] (2 responses)
Of course, this makes the function much less useful than the average C programmer assumes.
Posted Aug 25, 2022 22:03 UTC (Thu)
by tialaramex (subscriber, #21167)
[Link] (1 responses)
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]
Ushering out strlcpy()
Ushering out strlcpy()
strncpy
strncpy