From ad6994dcf28ec9d2d70e6ee72eaceb5f69cf7181 Mon Sep 17 00:00:00 2001
From: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
Date: Fri, 15 Jan 2010 12:41:29 +0000
Subject: [PATCH] use ostringstream and not char[256]

---
 Solver/dgSystemOfEquations.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Solver/dgSystemOfEquations.cpp b/Solver/dgSystemOfEquations.cpp
index 09d0d3fd2b..f1598de057 100644
--- a/Solver/dgSystemOfEquations.cpp
+++ b/Solver/dgSystemOfEquations.cpp
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <sstream>
 #include "dgSystemOfEquations.h"
 #include "function.h"
 #include "MElement.h"
@@ -174,9 +175,9 @@ void dgSystemOfEquations::export_solution_as_is (const std::string &name){
   // the elementnodedata::export does not work !!
 
   for (int ICOMP = 0; ICOMP<_claw->nbFields();++ICOMP){
-    char aaa[245];
-    sprintf(aaa,"%s_COMP_%d.msh",name.c_str(),ICOMP);
-    FILE *f = fopen (aaa,"w");
+    std::ostringstream name_oss;
+    name_oss<<name<<"_COMP_"<<ICOMP<<".msh";
+    FILE *f = fopen (name_oss.str().c_str(),"w");
     int COUNT = 0;
     for (int i=0;i < _elementGroups.size() ;i++){
       COUNT += _elementGroups[i]->getNbElements();
-- 
GitLab