This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v6] Implement strlcpy [BZ #178]


On 11/18/2015 10:41 AM, ricaljasan wrote:

>> +@comment string.h
>> +@comment BSD
>> +@deftypefun size_t strlcpy (char *restrict @var{to}, const char *restrict @var{from}, size_t @var{size})
>> +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This function is similar
> 
> The beginning of this line should be moved below the @safety macro.

Thanks, fixed.

>> +@strong{Note:} GNU programs should not use statically sized buffers for
>> +storing strings.  @xref{Semantics, , Writing Robust Programs, standards,
>> +The GNU Coding Standards}.  Instead of using @code{strlcpy}, it is
>> +usually better to use dynamic memory allocation and functions such as
>> +@code{strdup} or @code{asprintf} to construct strings.
> 
> A reference to dynamic memory allocation would be suitable here.

I added:

better to use dynamic memory allocation {+(@pxref{Unconstrained+}
{+Allocation})+} and functions such as @code{strdup} or @code{asprintf}

Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]