Re: trim whitespace
- From: John Kelly <jak@xxxxxxxxxxxx>
- Date: Wed, 25 Aug 2010 07:27:45 +0000
On Wed, 25 Aug 2010 00:15:50 -0700, "James" <no@xxxxxxxxxxxx> wrote:
But you have no safeguard against memory having no \0 byte.
Well, neither do you John. If I pass your function memory that does not have
a terminating NUL byte, then it will gladly read right past the bounds and
off into never never land...
You are thinking of C strings. There are no "bounds" to a pointer.
You can increment a pointer until it wraps back to 0, and repeat that
loop forever.
If you try to read that memory, you may segfault and terminate. But
that is beside the point. My code copes with an abstract machine where
one process owns all the memory, from 0 to the highest address.
That may not be a real world scenario, but again, that is beside the
point. My code copes with abstract near impossibilities. That's the
way a programmer should think.
--
Web mail, POP3, and SMTP
http://www.beewyz.com/freeaccounts.php
.
- Follow-Ups:
- Re: trim whitespace
- From: Keith Thompson
- Re: trim whitespace
- From: Ben Bacarisse
- Re: trim whitespace
- From: Seebs
- Re: trim whitespace
- References:
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: Lew Pitcher
- Re: trim whitespace
- From: Shao Miller
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: Shao Miller
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: Shao Miller
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: Shao Miller
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: James
- Re: trim whitespace
- Prev by Date: Re: Understanding some code
- Next by Date: Re: trim whitespace
- Previous by thread: Re: trim whitespace
- Next by thread: Re: trim whitespace
- Index(es):