From 45102da4ddce30220e3febaa4bbacf1fa70087b9 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Sat, 18 Feb 2017 19:35:01 +0100 Subject: [PATCH] Fix warnings for format in printf --- src/menu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/menu.cpp b/src/menu.cpp index 1c01a17..9f08678 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -275,7 +275,7 @@ void CMenu::Draw() if (m_errors[i] >= 100) // no ressource au lieu erreur ? { - snprintf (text, sizeof (text), m_texts[i]); + snprintf (text, sizeof (text), "%s", m_texts[i]); pText = strchr (text, '\n'); if (pText != nullptr) *pText = 0; @@ -283,7 +283,7 @@ void CMenu::Draw() else { const auto tr = GetText (m_buttons[i]); - snprintf (text, sizeof (text), tr); + snprintf (text, sizeof (text), "%s", tr); } if (m_nbCel.x > 1 && i < m_nbCel.y) @@ -315,7 +315,7 @@ void CMenu::Draw() { if (m_errors[i] >= 100) // no ressource au lieu erreur ? { - snprintf (text, sizeof (text), m_texts[i]); + snprintf (text, sizeof (text), "%s", m_texts[i]); pText = strchr (text, '\n'); if (pText != nullptr) strcpy (text, pText + 1); @@ -323,7 +323,7 @@ void CMenu::Draw() else { const auto tr = GetErr (m_errors[i] - 1); // impossible ici - snprintf (text, sizeof (text), tr); + snprintf (text, sizeof (text), "%s", tr); } if (m_nbCel.x > 1 && i < m_nbCel.y)