diff --git a/paddle/fluid/inference/tensorrt/convert/generic_and_custom_plugin_creater.cc b/paddle/fluid/inference/tensorrt/convert/generic_and_custom_plugin_creater.cc index da64a8fbb6811ab29ef361966f5f0002e267806c..474a88dd0c86b115ecbf95c3205db8ddbc572878 100644 --- a/paddle/fluid/inference/tensorrt/convert/generic_and_custom_plugin_creater.cc +++ b/paddle/fluid/inference/tensorrt/convert/generic_and_custom_plugin_creater.cc @@ -77,8 +77,10 @@ class CustomPluginCreater : public OpConverter { // NOTE: to avoid string rewrite by iterator, deep copy here std::vector plugin_attr_name(attr_name.length() + 1, 0); - snprintf( - plugin_attr_name.data(), attr_name.length() + 1, attr_name.c_str()); + snprintf(plugin_attr_name.data(), + attr_name.length() + 1, + "%s", + attr_name.c_str()); plugindata.name = plugin_attr_name.data(); if (op_desc.GetAttrType(attr_name) == framework::proto::AttrType::INT) {