This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Implement C11 annex K?
- From: Tolga Dalman <tolga dot dalman at googlemail dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 14 Aug 2014 00:46:37 +0200
- Subject: Re: Implement C11 annex K?
- Authentication-results: sourceware.org; auth=none
- References: <E1XHe8v-0004Ur-Hp at rmm6prod02 dot runbox dot com> <Pine dot LNX dot 4 dot 64 dot 1408132054090 dot 16622 at digraph dot polyomino dot org dot uk> <53EBD7D9 dot 1040008 at cs dot ucla dot edu> <20140813213520 dot GQ12888 at brightrain dot aerifal dot cx>
On 08/13/2014 11:35 PM, Rich Felker wrote:
> I agree totally that strlcpy is a bad
> API, and I don't recommend using it, but since apps are using it, it's
> much better to have a fully correct version in glibc than a buggy
> application-provided fallback -- and the latter is really common.
Your argumentation appears inconsistent to me. strlcpy is a bad API by design
and provides no benefits except convenience for some applications (how many use
these functions, btw ?). If an application chooses to use a non-portable
and probably buggy function, well, then the application should be fixed. Not
glibc.
This discussion comes up every few years with no new arguments. IMHO glibc has
done well not to encourage the use of strlcpy/strlcat over better alternatives.