diff options
Diffstat (limited to 'source/blender/io')
4 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/io/avi/intern/avi_codecs.c b/source/blender/io/avi/intern/avi_codecs.c index cbb96e12930..ba897ef808a 100644 --- a/source/blender/io/avi/intern/avi_codecs.c +++ b/source/blender/io/avi/intern/avi_codecs.c @@ -14,6 +14,8 @@ #include "avi_rgb.h" #include "avi_rgb32.h" +#include "BLI_string.h" + void *avi_format_convert( AviMovie *movie, int stream, void *buffer, AviFormat from, AviFormat to, size_t *size) { @@ -68,10 +70,10 @@ int avi_get_data_id(AviFormat format, int stream) char fcc[5]; if (avi_get_format_type(format) == FCC("vids")) { - sprintf(fcc, "%2.2ddc", stream); + BLI_snprintf(fcc, sizeof(fcc), "%2.2ddc", stream); } else if (avi_get_format_type(format) == FCC("auds")) { - sprintf(fcc, "%2.2ddc", stream); + BLI_snprintf(fcc, sizeof(fcc), "%2.2ddc", stream); } else { return 0; diff --git a/source/blender/io/collada/AnimationExporter.cpp b/source/blender/io/collada/AnimationExporter.cpp index 85e8ccf9f2a..24d2072f840 100644 --- a/source/blender/io/collada/AnimationExporter.cpp +++ b/source/blender/io/collada/AnimationExporter.cpp @@ -43,7 +43,8 @@ bool AnimationExporter::open_animation_container(bool has_container, Object *ob) { if (!has_container) { char anim_id[200]; - sprintf(anim_id, "action_container-%s", translate_id(id_name(ob)).c_str()); + BLI_snprintf( + anim_id, sizeof(anim_id), "action_container-%s", translate_id(id_name(ob)).c_str()); openAnimation(anim_id, encode_xml(id_name(ob))); } return true; diff --git a/source/blender/io/collada/GeometryExporter.cpp b/source/blender/io/collada/GeometryExporter.cpp index a069c32026b..f6f9026481c 100644 --- a/source/blender/io/collada/GeometryExporter.cpp +++ b/source/blender/io/collada/GeometryExporter.cpp @@ -522,7 +522,7 @@ std::string GeometryExporter::makeTexcoordSourceId(std::string &geom_id, suffix[0] = '\0'; } else { - sprintf(suffix, "-%d", layer_index); + BLI_snprintf(suffix, sizeof(suffix), "-%d", layer_index); } return getIdBySemantics(geom_id, COLLADASW::InputSemantic::TEXCOORD) + suffix; } diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc index 8acb87f8e58..b85fd33e116 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc @@ -90,7 +90,8 @@ void GpencilExporterSVG::create_document_header() pugi::xml_node comment = main_doc_.append_child(pugi::node_comment); char txt[128]; - sprintf(txt, " Generator: Blender, %s - %s ", SVG_EXPORTER_NAME, SVG_EXPORTER_VERSION); + BLI_snprintf( + txt, sizeof(txt), " Generator: Blender, %s - %s ", SVG_EXPORTER_NAME, SVG_EXPORTER_VERSION); comment.set_value(txt); pugi::xml_node doctype = main_doc_.append_child(pugi::node_doctype); @@ -147,7 +148,7 @@ void GpencilExporterSVG::export_gpencil_layers() pugi::xml_node ob_node = frame_node_.append_child("g"); char obtxt[96]; - sprintf(obtxt, "blender_object_%s", ob->id.name + 2); + BLI_snprintf(obtxt, sizeof(obtxt), "blender_object_%s", ob->id.name + 2); ob_node.append_attribute("id").set_value(obtxt); /* Use evaluated version to get strokes with modifiers. */ @@ -402,7 +403,7 @@ std::string GpencilExporterSVG::rgb_to_hexstr(const float color[3]) uint8_t g = color[1] * 255.0f; uint8_t b = color[2] * 255.0f; char hex_string[20]; - sprintf(hex_string, "#%02X%02X%02X", r, g, b); + BLI_snprintf(hex_string, sizeof(hex_string), "#%02X%02X%02X", r, g, b); std::string hexstr = hex_string; |