This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Implement strlcat [BZ#178]
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 3 Dec 2015 14:42:13 -0800
- Subject: Re: [PATCH] Implement strlcat [BZ#178]
- Authentication-results: sourceware.org; auth=none
- References: <56547472 dot 3010302 at redhat dot com> <5654B1FE dot 5020100 at cs dot ucla dot edu> <5654B796 dot 7070302 at redhat dot com> <5656E018 dot 5020608 at cs dot ucla dot edu> <565F211A dot 2030909 at redhat dot com> <56607CD1 dot 3050209 at cs dot ucla dot edu> <CAKCAbMgDMK9wjfNEJYW7e-cN9s5aVhun6V08OXrcOgYKRYF7_g at mail dot gmail dot com> <5660825E dot 9020901 at cs dot ucla dot edu> <CAKCAbMi2zSJRjS=ceg8UvTYY18UrCWysaOFX+OzvKZQfeR9+SA at mail dot gmail dot com>
On 12/03/2015 10:08 AM, Zack Weinberg wrote:
char *my_strdup(char *s)
Sorry, I should have been clearer. I'd like to see real-world
applications that care about these weird corner cases. I'm skeptical
that such applications exist. I'm sure that one can find contrived
examples and feature-test programs and suchlike, but production code?
I would actively expect strlcpy (0, SRC, 0) to be used
Any such usage would not work under NetBSD's current strlcpy
implementation, which does not allow the destination to be a null
pointer. So strlcpy (0, SRC, 0) is already not portable, and we don't
need to support it.
If we're going to have these functions at all, they need to work
_exactly_ as they do on *BSD
There is no "_exactly_". The BSDs differ.
As you know, I'd rather we didn't support these poorly-designed APIs;
but if we do support them at least we can help out a bit by catching any
apps that fall into these API's weirder cracks.