diff --git a/spot/twa/acc.cc b/spot/twa/acc.cc index 4c4013ce7..0549ce462 100644 --- a/spot/twa/acc.cc +++ b/spot/twa/acc.cc @@ -2134,7 +2134,7 @@ namespace spot if (*input != c) { char msg[20]; - sprintf(msg, "was expecting %c '.'", c); + std::snprintf(msg, sizeof msg, "was expecting '%c'.", c); syntax_error(input, msg); } ++input; diff --git a/spot/twaalgos/aiger.cc b/spot/twaalgos/aiger.cc index 6b608dd59..7d724b124 100644 --- a/spot/twaalgos/aiger.cc +++ b/spot/twaalgos/aiger.cc @@ -2224,7 +2224,7 @@ namespace spot // vars are unsigned -> 10 digits at most char gate_buffer[3 * 10 + 5]; 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; }; // Count active gates