[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] strnstr
From: |
Bruno Haible |
Subject: |
Re: [Bug-gnulib] strnstr |
Date: |
Wed, 29 Sep 2004 21:16:55 +0200 |
User-agent: |
KMail/1.5 |
Simon Josefsson wrote:
> Darwin and FreeBSD has this, and GnuTLS is using it.
Hmm. FreeBSD has some str'n' functions that work on truncated strings,
i.e. it always uses MIN (strlen(s), N) as actual length. This seems
like a broken concept to me, because
- it is slower than just using strlen(s) or N as actual length,
- it provides the illusion of being safe, but isn't because it will
silently truncate strings, thus producing garbage effects at will,
- the common GNU concept is to allocate strings that are as long as
they need to be.
However, your use in GnuTLS appears to be different. You are using
functions that work on pieces of buffers, i.e. on not NUL terminated
memory regions, right? If so, what is the complete list of functions
that you need? memchr(), memrchr(), memstr(), memrstr(), I guess?
Bruno
- [Bug-gnulib] strnstr, Simon Josefsson, 2004/09/29
- Re: [Bug-gnulib] strnstr,
Bruno Haible <=
- Re: [Bug-gnulib] strnstr, Paul Eggert, 2004/09/29
- [Bug-gnulib] Re: strnstr, Simon Josefsson, 2004/09/29
- [Bug-gnulib] memstr (was: Re: strnstr), Simon Josefsson, 2004/09/30
- Re: [Bug-gnulib] memstr, Paul Eggert, 2004/09/30
- [Bug-gnulib] Re: memstr, Simon Josefsson, 2004/09/30
- Re: [Bug-gnulib] Re: memstr, Paul Eggert, 2004/09/30