[differential_equations] error message fixed 66/18766/1
Cedric Delamarre [Wed, 7 Dec 2016 17:58:10 +0000 (18:58 +0100)]
  after https://codereview.scilab.org/#/c/18764/

Change-Id: I00b912aa6704b6c3b98f2c2b6424960541de10ab

scilab/modules/differential_equations/sci_gateway/cpp/sci_ode.cpp

index 0fcbca7..d177bdb 100644 (file)
@@ -1362,11 +1362,11 @@ types::Function::ReturnValue sci_ode(types::typed_list &in, int _iRetCount, type
 
                 if (bCatch)
                 {
-                    char sError[bsiz];
-                    os_sprintf(sError, "%ls: An error occured in '%s' subroutine.\n", L"ode", strMeth.c_str());
-                    wchar_t* szError = to_wide_string(sError);
+                    wchar_t szError[bsiz];
+                    wchar_t* tmp = to_wide_string(strMeth.c_str());
+                    os_swprintf(szError, bsiz, _W("%ls: An error occured in '%ls' subroutine.\n").c_str(), L"ode", tmp);
                     os << szError;
-                    FREE(szError);
+                    FREE(tmp);
                     throw ast::InternalError(os.str());
                 }