Fix format-security violations (#802)
croak() expects printf-style format strings. Calling croak(e.what()) directly causes compilations to fail with -Werror=format-security
This commit is contained in:
parent
86b79f89ad
commit
a32281c268
@ -23,7 +23,7 @@
|
|||||||
try {
|
try {
|
||||||
THIS->do_export(print, path);
|
THIS->do_export(print, path);
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
croak(e.what());
|
croak("%s\n", e.what());
|
||||||
}
|
}
|
||||||
%};
|
%};
|
||||||
void do_export_w_preview(Print *print, const char *path, GCodePreviewData *preview_data)
|
void do_export_w_preview(Print *print, const char *path, GCodePreviewData *preview_data)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
try {
|
try {
|
||||||
RETVAL = THIS->process(str, 0);
|
RETVAL = THIS->process(str, 0);
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
croak(e.what());
|
croak("%s\n", e.what());
|
||||||
}
|
}
|
||||||
%};
|
%};
|
||||||
|
|
||||||
@ -27,7 +27,7 @@
|
|||||||
try {
|
try {
|
||||||
RETVAL = THIS->evaluate_boolean_expression(str, THIS->config());
|
RETVAL = THIS->evaluate_boolean_expression(str, THIS->config());
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
croak(e.what());
|
croak("%s\n", e.what());
|
||||||
}
|
}
|
||||||
%};
|
%};
|
||||||
};
|
};
|
||||||
|
@ -212,7 +212,7 @@ _constant()
|
|||||||
try {
|
try {
|
||||||
RETVAL = THIS->output_filepath(path);
|
RETVAL = THIS->output_filepath(path);
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
croak(e.what());
|
croak("%s\n", e.what());
|
||||||
}
|
}
|
||||||
%};
|
%};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user