I wrote:
>    In some places the users
>    will notice that strlcpy does not buy them much, compared to the
>    "avoid arbitrary limits"[1] approach, and will switch over to what
>    you call "GNU style". In other places, they will insert an abort()
>    or assert() to handle the truncation case - which is *better* than
>    the strncpy approach.

For example, in gnulib's setlocale.c override. This file has fixed-size
buffers and silent truncation - because it uses the "strncpy and set NUL byte"
approach. As soon as someone (me) will use strlcpy with __warn_unused_result__
there, he will change the code to do
  - either dynamic allocation and no arbitrary limits,
  - or provide a good alternative to the silent truncation.
Either result will be better than the current one.

Bruno


Reply via email to