From d96796121af28b4bb6958abb1b58ad34c178e817 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 13 Sep 2023 15:39:36 +0200 Subject: [PATCH] replace sprintf by snprintf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- spot/twa/acc.cc | 2 +- spot/twaalgos/aiger.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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