autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String functions with end pointers?


From: Stepan Kasal
Subject: Re: String functions with end pointers?
Date: Tue, 25 Apr 2006 19:54:14 +0200
User-agent: Mutt/1.4.1i

Hello,

On Tue, Apr 25, 2006 at 08:51:48AM -0400, Paul D. Smith wrote:
> %% Paul Eggert <address@hidden> writes:
>   pe> In fact, come to think of it, I wouldn't use str* at all, since the
>   pe> functions you're talking about work on arbitrary memory buffers
>   pe> that can contain internal NULs.
> 
> I was going to protest at first: strncat() checks for both nul and the
> length, and I was thinking the new string functions would do likewise.
> 
> But, on second thought, I don't know that I need this.  If I have a
> pointer to the end I'm pretty sure it's always on or before the nul
> char.

IMHO, it would be a very important part of the design that the
proposed "meme*" functions do not check for internal NULs.
For example, modern interpreted languages allow for NULs in their
strings; this feature would help with the implementation.

Or, simply said, if the end pointer denotes the end of the string,
it would be bad to say that there are cases when this is not the real
end of the string.

Have a nice day,
        Stepan Kasal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]