Re: strlcpy missing on Linux
- From: Thomas Maier-Komor <thomas@xxxxxxxxxxxxxx>
- Date: Fri, 07 Apr 2006 13:25:30 +0200
Nils O. Selåsdal wrote:
Thomas Maier-Komor wrote:
Hi,Follow the threads at
does anybody know if there is any specific reason, why Linux's glibc is
missing strlcpy?
http://sources.redhat.com/ml/libc-alpha/2000-08/msg00053.html
http://sources.redhat.com/ml/libc-alpha/2002-01/msg00001.html
Thanks. That was a little bit enlightening. I didn't read everything,
but I can say that I totally disagree with the opinion that a program
always has to know how long its strings are.
Reason:
Reading from standard input, you will never be able to determine how
much data you will get. In this case strlcpy can ease the implementation
because it is a) safe, b) tells you when it runs out of memory, c) says
how much has been copied. So it is really convenient to implement an
exception mechanism that supports starting with a small buffer and
increasing it in size when necessary.
But I think this isn't the first time that Linux or glibc developers
know better how to solve problems that they don't have. Very sad.
Tom
.
- Follow-Ups:
- Re: strlcpy missing on Linux
- From: James Antill
- Re: strlcpy missing on Linux
- From: "Nils O. Selåsdal"
- Re: strlcpy missing on Linux
- References:
- strlcpy missing on Linux
- From: Thomas Maier-Komor
- Re: strlcpy missing on Linux
- From: "Nils O. Selåsdal"
- strlcpy missing on Linux
- Prev by Date: Re: backspace and delete key mappings
- Next by Date: Re: strlcpy missing on Linux
- Previous by thread: Re: strlcpy missing on Linux
- Next by thread: Re: strlcpy missing on Linux
- Index(es):
Relevant Pages
|