From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Accessing The Command Line Date: Thu, 4 Jul 2024 15:01:05 +0200 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 04 Jul 2024 15:01:04 +0200 (CEST) Injection-Info: dont-email.me; posting-host="8a19cd8763c80b40562dd2a0add3015c"; logging-data="2920978"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UgV8r737To38Y+QygxJcJH+jRSkOWur0=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:8QMvktob6t9/FPsrYHkzQyKqaqo= In-Reply-To: Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:66219 List-Id: On 2024-07-04 02:08, Lawrence D'Oliveiro wrote: > with Ada.Command_Line; > with Ada.Text_IO; [...] A general advice processing strings, any strings: messages, commands, payload etc. Always read a complete string into a fixed size buffer (safety). Never use streams. Process the whole string consequently. Never tokenize. Never copy anything. Ada has slices. The same is true for the output. Build a complete substring in a buffer. Consequently. Flush the complete substring to the output. Do not use Unbounded_String. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de