[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module 'strlcpy'

From: Paul Eggert
Subject: Re: new module 'strlcpy'
Date: Thu, 28 Sep 2017 11:01:34 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 09/27/2017 11:29 PM, Dmitry Selyutin wrote:
How about strscpy from the Linux kernel?

Yes, that's a better API than strlcpy. Though I would change its ssize_t to ptrdiff_t, so that it depends only on stddef.h. Plus, I would define its behavior even if the buffers overlap - that's safer, and the function is for when safety is more important than performance or correctness.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]