Alexander V. Chernikov | 30 Jul 2012 09:41
Picon
Favicon
Gravatar

use of strlcpy

Hello list!

Currently we have
11:32 [0] fbsd8# egrep -RI 'strn?cpy' . 2>/dev/null | wc -l
       44

items which are mostly strcpy.
Maybe we can add strlcpy() to linux sysdep code and convert most of 
these calls?

I can provide patch if needed

Juho Juopperi | 15 Aug 2012 01:33
Picon
Gravatar

Re: use of strlcpy

On 2012-07-30, at 10:41, Alexander V. Chernikov <melifaro <at> ipfw.ru> wrote:
...
> items which are mostly strcpy.
> Maybe we can add strlcpy() to linux sysdep code and convert most of these calls?

Just remember that strncpy pads rest of the output buffer with zeroes and strlcpy does not. If anything
might depend on this, have calloc()ed output buffer or memset() before use. Otherwise strlcpy sounds
like a plan.

--

-- 
Juho Juopperi
jkj <at> f-solutions.fi
+358405422321


Gmane