From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8f802583e5c84fa X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news1.optus.net.au!optus!newsfeeder.syd.optusnet.com.au!news.optusnet.com.au!newsfeed.pacific.net.au!nasal.pacific.net.au!not-for-mail Newsgroups: comp.lang.ada Subject: Re: String filtering From: David Trudgett Organization: Very little? References: <-NadnU7jqYrhFaTeRVn-tw@comcast.com> Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:6LzXCn4mL35dzgcfU+OMqs1pj30= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 28 Sep 2005 11:20:54 +1000 NNTP-Posting-Host: 61.8.35.118 X-Complaints-To: news@pacific.net.au X-Trace: nasal.pacific.net.au 1127870732 61.8.35.118 (Wed, 28 Sep 2005 11:25:32 EST) NNTP-Posting-Date: Wed, 28 Sep 2005 11:25:32 EST Xref: g2news1.google.com comp.lang.ada:5215 Date: 2005-09-28T11:20:54+10:00 List-Id: tmoran@acm.org 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.