Re: programming
so, there is no way to know in advance the length of a string unless you
have an identifier, or constant for it.
thanks for the tip andrew. Im sure it will be useful someday.
On Mon, 5 Nov 2001, Andrew Agno wrote:
> J.A.Serralheiro writes:
> > right. It should be strlen(buff )
>
> Just a word of warning: strlen can be a problem if the buffer is not
> filled with stuff that you can validate--ie: if buff isn't a NULL
> terminated string, then it looks for the NULL byte off the end of the
> buffer, which can lead to much strangeness, and probably core dumps,
> later on. So even if you get a length using strlen, you should make
> sure it doesn't go beyond the end of the buffer.
>
> Andrew.
>
>
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>
Reply to: