Re: String filtering
- From: David Trudgett <wpower@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 28 Sep 2005 11:20:54 +1000
tmoran@xxxxxxx writes:
>>I am sanitising data received over a socket, which may be of any
>>length. Hence my use of unbounded_string, ...
> Yes indeed. For instance some bad program might send you an
> unlimited series of characters and your program would work, then
> crawl as it thrashed in virtual memory, then eventually crash as
> everything was full. Surely there's some number above which "this
> can't be right!" and that can be your Fixed or Bounded string size.
Yes, I had thought of that... ;-) As it happens, according to the
documentation, Get_Line will truncate to the buffer size set with
Set_Buffer (or a default of 1500 IIRC).
So, I could use String(1 .. 1500) (or whatever), wasting a bit of
space, or I could just use... unbounded strings.
Cheers,
David
--
David Trudgett
http://www.zeta.org.au/~wpower/
As a computer, I find your faith in technology amusing.
.
- References:
- Re: String filtering
- From: David Trudgett
- Re: String filtering
- From: tmoran
- Re: String filtering
- Prev by Date: Re: String filtering
- Next by Date: Re: String filtering
- Previous by thread: Re: String filtering
- Next by thread: Re: String filtering
- Index(es):