Sujet : Re: Accessing The Command Line
De : mailbox (at) *nospam* dmitry-kazakov.de (Dmitry A. Kazakov)
Groupes : comp.lang.adaDate : 04. Jul 2024, 14:01:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v666eg$2p4gi$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
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. Kazakovhttp://www.dmitry-kazakov.de