8 ms·
I’m always glad to see more people coming around to the fact that memccpy is the actual function they want, not these inefficient nonstandard garbage functions
by saagarjha 2y ago
I’m always glad to see more people coming around to the fact that memccpy is the actual function they want, not these inefficient nonstandard garbage functions that are needlessly inefficient for no reason but that everyone flocks to anyways for “security”.
- SAI_Peregrinus 2y agoI just wish it also had a src_size. As it is, if dest is bigger than src, and src isn't null-terminated, it'll read past the end of src. You can make a MIN macro and use MIN(dest_size, src_size), but shouldn't have to IMO.
- wruza 2y agoThat’s exactly my experience with most of C. You go through a history of half-assed changes and realize that you’re still halfway there in $current_year, wondering how many years will it take to fix any of these obvious flaws. Committee surely has its reasons but on the surface it seems completely non-practicing, to say the least.