4 ms·
stpncpy is a poor choice as a efficient “safe” string copying routine. The right choice is memccpy, which (thankfully) is part of C2X. Discussion as to why is h
by saagarjha 6y ago
stpncpy is a poor choice as a efficient “safe” string copying routine. The right choice is memccpy, which (thankfully) is part of C2X. Discussion as to why is here: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2349.htm http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2349.htm, and I have words on it too: https://saagarjha.com/blog/2020/04/12/designing-a-better-strcpy/ https://saagarjha.com/blog/2020/04/12/designing-a-better-str...