replace sprintf by snprintf

This was reported by Pierre Ganty, who said that sprintf is reported
as deprecated on MacOS 13.5.2 (22G91).

* spot/twa/acc.cc, spot/twaalgos/aiger.cc: Here.
This commit is contained in:
Alexandre Duret-Lutz 2023-09-13 15:39:36 +02:00
parent 7149521f48
commit d96796121a
2 changed files with 2 additions and 2 deletions

View file

@ -2134,7 +2134,7 @@ namespace spot
if (*input != c) if (*input != c)
{ {
char msg[20]; char msg[20];
sprintf(msg, "was expecting %c '.'", c); std::snprintf(msg, sizeof msg, "was expecting '%c'.", c);
syntax_error(input, msg); syntax_error(input, msg);
} }
++input; ++input;

View file

@ -2224,7 +2224,7 @@ namespace spot
// vars are unsigned -> 10 digits at most // vars are unsigned -> 10 digits at most
char gate_buffer[3 * 10 + 5]; char gate_buffer[3 * 10 + 5];
auto write_gate = [&](unsigned o, unsigned i0, unsigned i1) { auto write_gate = [&](unsigned o, unsigned i0, unsigned i1) {
std::sprintf(gate_buffer, "%u %u %u\n", o, i0, i1); std::snprintf(gate_buffer, sizeof gate_buffer, "%u %u %u\n", o, i0, i1);
os << gate_buffer; os << gate_buffer;
}; };
// Count active gates // Count active gates