Re: [RFC] strcpys(): New function for copying strings safely

From: Alejandro Colomar (man-pages)
Date: Mon Jun 28 2021 - 08:10:46 EST


On 6/28/21 2:00 PM, Alejandro Colomar (man-pages) wrote:
l = strscat(n - l, dest + l, src2);

Hmm, that's a bug; I wrote it too fast.

Either

l += strscpy(n - l, dest + l, src2);

or

l = strscat(n - l, dest, src2);

should be used instead.

--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/