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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Problem with Unbounded Strings Date: Fri, 4 Dec 2015 23:02:30 +0100 Organization: cbb software GmbH Message-ID: <1oxx3iyyndamb$.o30no3w0t1vu$.dlg@40tude.net> References: <274dc49b-b7cd-4eef-b333-34bae665c992@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: Sfz0eNwKWh4Uq03iti+GMw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28646 Date: 2015-12-04T23:02:30+01:00 List-Id: On Fri, 4 Dec 2015 13:21:55 -0800 (PST), Laurent wrote: [...] Works just fine with GNAT GPL 2015. Try to print Length (Buffer) as well to see how long the string actually is. You could have problems with controlling characters. 1. When dealing with character files, it is better to use Stream I/O instead of Text_IO and recognize line ends manually instead of Get_Line. The way the protocol defines line termination might be incompatible with one of Get_Line and/or the OS. 2. Buffer should be an "in out" parameter. It is not a big difference in this case, but cleaner. 3. You should never use End_Of_File. It might be quite expensive or not working, e.g. some the protocol may deploy explicit terminators, like EOF. Exit file read loops with End_Error exception. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de