From d4b4060d69c85c0b96eb126487d4cec68380560c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien.villemot@ens.fr>
Date: Mon, 7 Nov 2011 15:28:11 +0100
Subject: [PATCH] Fix build failure with -Werror=format-security

See Debian bug #646258 (http://bugs.debian.org/646258) and
http://wiki.debian.org/ReleaseGoals/SecurityHardeningBuildFlags for details.
---
 dynare++/sylv/cc/SylvException.cpp               | 2 +-
 mex/sources/estimation/InitializeKalmanFilter.cc | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dynare++/sylv/cc/SylvException.cpp b/dynare++/sylv/cc/SylvException.cpp
index 4671ef8c31..43206138cf 100644
--- a/dynare++/sylv/cc/SylvException.cpp
+++ b/dynare++/sylv/cc/SylvException.cpp
@@ -26,7 +26,7 @@ void SylvException::printMessage() const
 	char mes[1500];
 	mes[0] = '\0';
 	printMessage(mes, 1499);
-	printf(mes);
+	puts(mes);
 }
 
 int SylvException::printMessage(char* str, int maxlen) const
diff --git a/mex/sources/estimation/InitializeKalmanFilter.cc b/mex/sources/estimation/InitializeKalmanFilter.cc
index 34eb46b4c8..c409b23d0c 100644
--- a/mex/sources/estimation/InitializeKalmanFilter.cc
+++ b/mex/sources/estimation/InitializeKalmanFilter.cc
@@ -113,14 +113,14 @@ InitializeKalmanFilter::setPstar(Matrix &Pstar, Matrix &Pinf, const Matrix &T, c
     {
       if (e.info > 0) // The matrix is not positive definite in NormCholesky calculator
         {
-          printf(e.message.c_str());
+          puts(e.message.c_str());
           info = -1; //likelihood = penalty;
           return;
         }
       else if (e.info < 0)
         {
           printf("Caugth unhandled TS exception with Pstar matrix: ");
-          printf(e.message.c_str());
+          puts(e.message.c_str());
           info = -1; //likelihood = penalty;
           throw;
         }
-- 
GitLab