Re: String filtering



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.

.