Thanks to all for the inputs and Ivan and Martin for the cleaner code you
suggest and which I will definitely use.
Iago
Sent with Proton Mail secure email.
On Monday, 20 November 2023 at 10:09, Martin Maechler
wrote:
> > > > > > Serguei Sokol
> > > > > > on Mon, 20 Nov 2023 10:04:10 +010
> Serguei Sokol
> on Mon, 20 Nov 2023 10:04:10 +0100 writes:
> Le 19/11/2023 à 02:07, Iris Simmons a écrit :
>> Yes, the reason for the error is the use of sprintf. You can instead use
>> snprintf where n is the maximum number of bytes to write, including the
>> termin
The n in snprintf includes the room for the terminating nul. It should be
8191. If gcc is throwing a warning, it can be ignored.
On Mon, Nov 20, 2023, 04:04 Serguei Sokol wrote:
> Le 19/11/2023 à 02:07, Iris Simmons a écrit :
> > Yes, the reason for the error is the use of sprintf. You can inste
Le 19/11/2023 à 02:07, Iris Simmons a écrit :
Yes, the reason for the error is the use of sprintf. You can instead use
snprintf where n is the maximum number of bytes to write, including the
terminating nul character. For example:
char msg[8191];
snprintf(msg, 8191, "criteria: error (%d) -> %s\n