Merge branch 'format-security'

* format-security:
  Add changes entry for Octave 5.1 format-security fix
  Fix format-security error with octave 5.1
This commit is contained in:
William S Fulton 2019-03-11 19:04:41 +00:00
commit d15c8ea192
2 changed files with 7 additions and 2 deletions

View file

@ -7,6 +7,11 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.0.0 (in progress)
===========================
2019-03-11: dirteat,opoplawski
[Octave] Fix compilation errors in Octave 5.1.
error: format not a string literal and no format arguments [-Werror=format-security]
2019-02-28: wsfulton
[Java] std::vector improvements for types that do not have a default constructor.

View file

@ -51,7 +51,7 @@ SWIGRUNTIME octave_value SWIG_Error(int code, const char *msg) {
octave_value type(SWIG_ErrorType(code));
std::string r = msg;
r += " (" + type.string_value() + ")";
error(r.c_str());
error("%s", r.c_str());
return octave_value(r);
}
@ -840,7 +840,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
const std::string opname = std::string("__") + octave_base_value::get_umap_name(umap) + std::string("__");
octave_value ret;
if (!dispatch_unary_op(opname, ret)) {
error((opname + std::string(" method not found")).c_str());
error("%s", (opname + std::string(" method not found")).c_str());
return octave_value();
}
return ret;