Re: trim whitespace
- From: "James" <no@xxxxxxxxxxxx>
- Date: Wed, 25 Aug 2010 00:15:50 -0700
"John Kelly" <jak@xxxxxxxxxxxx> wrote in message
news:buf9761b53l2sg9d3869ihdl5f3aochnsp@xxxxxxxxxx
On Wed, 25 Aug 2010 02:50:48 -0400, Shao Miller <sha0.miller@xxxxxxxxx>
wrote:
For reference, here's the code again:
It's clean, concise, and looks good.
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...
Your code
can go into an infinite loop. Mine cannot.
They will both launch nukes if I pass them non-NUL terminated memory.
My code may not be as pretty, but I don't think you can match its run
time performance.
.
- Follow-Ups:
- Re: trim whitespace
- From: Seebs
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- References:
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: Shao Miller
- 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
- Prev by Date: Re: trim whitespace
- Next by Date: Const Issue
- Previous by thread: Re: trim whitespace
- Next by thread: Re: trim whitespace
- Index(es):
Relevant Pages
|