Use UTF8 copy function to ensure valid UTF8 output

This commit is contained in:
Campbell Barton
2023-05-13 17:38:48 +10:00
parent 4e85d17000
commit 169dd2a2b4
33 changed files with 79 additions and 74 deletions
+1 -1
View File
@@ -422,7 +422,7 @@ bActionGroup *action_groups_add_new(bAction *act, const char name[])
/* make it selected, with default name */
agrp->flag = AGRP_SELECTED;
STRNCPY(agrp->name, name[0] ? name : DATA_("Group"));
STRNCPY_UTF8(agrp->name, name[0] ? name : DATA_("Group"));
/* add to action, and validate */
BLI_addtail(&act->groups, agrp);
+2 -2
View File
@@ -131,8 +131,8 @@ KeyingSet *BKE_keyingset_add(
/* allocate new KeyingSet */
ks = MEM_callocN(sizeof(KeyingSet), "KeyingSet");
STRNCPY(ks->idname, (idname) ? idname : (name) ? name : DATA_("KeyingSet"));
STRNCPY(ks->name, (name) ? name : (idname) ? idname : DATA_("Keying Set"));
STRNCPY_UTF8(ks->idname, (idname) ? idname : (name) ? name : DATA_("KeyingSet"));
STRNCPY_UTF8(ks->name, (name) ? name : (idname) ? idname : DATA_("Keying Set"));
ks->flag = flag;
ks->keyingflag = keyingflag;
@@ -258,12 +258,7 @@ bool BKE_id_attribute_calc_unique_name(ID *id, const char *name, char *outname)
/* Set default name if none specified.
* NOTE: We only call IFACE_() if needed to avoid locale lookup overhead. */
if (!name || name[0] == '\0') {
BLI_strncpy(outname, IFACE_("Attribute"), name_maxncpy);
}
else {
BLI_strncpy_utf8(outname, name, name_maxncpy);
}
BLI_strncpy_utf8(outname, (name && name[0]) ? name : IFACE_("Attribute"), name_maxncpy);
const char *defname = ""; /* Dummy argument, never used as `name` is never zero length. */
return BLI_uniquename_cb(unique_name_cb, &data, defname, '.', outname, name_maxncpy);
+1 -1
View File
@@ -1617,7 +1617,7 @@ BoidRule *boid_new_rule(int type)
rule->type = type;
rule->flag |= BOIDRULE_IN_AIR | BOIDRULE_ON_LAND;
STRNCPY(rule->name, DATA_(rna_enum_boidrule_type_items[type - 1].name));
STRNCPY_UTF8(rule->name, DATA_(rna_enum_boidrule_type_items[type - 1].name));
return rule;
}
@@ -30,6 +30,7 @@
#include "BLI_span.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BLI_string_utf8.h"
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
@@ -4413,7 +4414,7 @@ void CustomData_set_layer_unique_name(CustomData *data, const int index)
/* Set default name if none specified. Note we only call DATA_() when
* needed to avoid overhead of locale lookups in the depsgraph. */
if (nlayer->name[0] == '\0') {
STRNCPY(nlayer->name, DATA_(typeInfo->defaultname));
STRNCPY_UTF8(nlayer->name, DATA_(typeInfo->defaultname));
}
const char *defname = ""; /* Dummy argument, never used as `name` is never zero length. */
@@ -4437,10 +4438,10 @@ void CustomData_validate_layer_name(const CustomData *data,
* deleted, so assign the active layer to name
*/
index = CustomData_get_active_layer_index(data, type);
BLI_strncpy(outname, data->layers[index].name, MAX_CUSTOMDATA_LAYER_NAME);
BLI_strncpy_utf8(outname, data->layers[index].name, MAX_CUSTOMDATA_LAYER_NAME);
}
else {
BLI_strncpy(outname, name, MAX_CUSTOMDATA_LAYER_NAME);
BLI_strncpy_utf8(outname, name, MAX_CUSTOMDATA_LAYER_NAME);
}
}
@@ -405,7 +405,7 @@ static bool surface_duplicateNameExists(void *arg, const char *name)
void dynamicPaintSurface_setUniqueName(DynamicPaintSurface *surface, const char *basename)
{
char name[64];
STRNCPY(name, basename); /* in case basename is surface->name use a copy */
STRNCPY_UTF8(name, basename); /* in case basename is surface->name use a copy */
BLI_uniquename_cb(
surface_duplicateNameExists, surface, name, '.', surface->name, sizeof(surface->name));
}
@@ -16,6 +16,7 @@
#include "BLI_expr_pylike_eval.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string_utf8.h"
#include "BLI_string_utils.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
@@ -955,7 +956,7 @@ DriverVar *driver_add_new_variable(ChannelDriver *driver)
BLI_addtail(&driver->variables, dvar);
/* Give the variable a 'unique' name. */
strcpy(dvar->name, CTX_DATA_(BLT_I18NCONTEXT_ID_ACTION, "var"));
STRNCPY_UTF8(dvar->name, CTX_DATA_(BLT_I18NCONTEXT_ID_ACTION, "var"));
BLI_uniquename(&driver->variables,
dvar,
CTX_DATA_(BLT_I18NCONTEXT_ID_ACTION, "var"),
@@ -675,7 +675,7 @@ bGPDlayer *BKE_gpencil_layer_addnew(bGPdata *gpd,
}
/* auto-name */
STRNCPY(gpl->info, DATA_(name));
STRNCPY_UTF8(gpl->info, DATA_(name));
BLI_uniquename(&gpd->layers,
gpl,
(gpd->flag & GP_DATA_ANNOTATIONS) ? DATA_("Note") : DATA_("GP_Layer"),
@@ -356,7 +356,7 @@ GpencilModifierData *BKE_gpencil_modifier_new(int type)
GpencilModifierData *md = MEM_callocN(mti->struct_size, mti->struct_name);
/* NOTE: this name must be made unique later. */
STRNCPY(md->name, DATA_(mti->name));
STRNCPY_UTF8(md->name, DATA_(mti->name));
md->type = type;
md->mode = eGpencilModifierMode_Realtime | eGpencilModifierMode_Render;
+1 -1
View File
@@ -1845,7 +1845,7 @@ KeyBlock *BKE_keyblock_add(Key *key, const char *name)
}
else {
if (tot == 1) {
STRNCPY(kb->name, DATA_("Basis"));
STRNCPY_UTF8(kb->name, DATA_("Basis"));
}
else {
SNPRINTF(kb->name, DATA_("Key %d"), tot - 1);
+2 -7
View File
@@ -2522,7 +2522,7 @@ ViewLayerAOV *BKE_view_layer_add_aov(ViewLayer *view_layer)
ViewLayerAOV *aov;
aov = MEM_cnew<ViewLayerAOV>(__func__);
aov->type = AOV_TYPE_COLOR;
STRNCPY(aov->name, DATA_("AOV"));
STRNCPY_UTF8(aov->name, DATA_("AOV"));
BLI_addtail(&view_layer->aovs, aov);
viewlayer_aov_active_set(view_layer, aov);
viewlayer_aov_make_name_unique(view_layer);
@@ -2642,12 +2642,7 @@ ViewLayerLightgroup *BKE_view_layer_add_lightgroup(ViewLayer *view_layer, const
{
ViewLayerLightgroup *lightgroup;
lightgroup = MEM_cnew<ViewLayerLightgroup>(__func__);
if (name && name[0]) {
STRNCPY(lightgroup->name, name);
}
else {
STRNCPY(lightgroup->name, DATA_("Lightgroup"));
}
STRNCPY_UTF8(lightgroup->name, (name && name[0]) ? name : DATA_("Lightgroup"));
BLI_addtail(&view_layer->lightgroups, lightgroup);
viewlayer_lightgroup_active_set(view_layer, lightgroup);
viewlayer_lightgroup_make_name_unique(view_layer, lightgroup);
+1 -1
View File
@@ -1603,7 +1603,7 @@ bool BKE_id_new_name_validate(
if (name[0] == '\0') {
/* Disallow empty names. */
STRNCPY(name, DATA_(BKE_idtype_idcode_to_name(GS(id->name))));
STRNCPY_UTF8(name, DATA_(BKE_idtype_idcode_to_name(GS(id->name))));
}
else {
/* disallow non utf8 chars,
+2 -1
View File
@@ -37,6 +37,7 @@
#include "BLI_path_util.h"
#include "BLI_session_uuid.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
@@ -137,7 +138,7 @@ static ModifierData *modifier_allocate_and_init(ModifierType type)
ModifierData *md = static_cast<ModifierData *>(MEM_callocN(mti->structSize, mti->structName));
/* NOTE: this name must be made unique later. */
STRNCPY(md->name, DATA_(mti->name));
STRNCPY_UTF8(md->name, DATA_(mti->name));
md->type = type;
md->mode = eModifierMode_Realtime | eModifierMode_Render;
+2 -1
View File
@@ -40,6 +40,7 @@
#include "BLI_set.hh"
#include "BLI_stack.hh"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_string_utils.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
@@ -1159,7 +1160,7 @@ static void node_init(const bContext *C, bNodeTree *ntree, bNode *node)
* Data have their own translation option!
* This solution may be a bit rougher than nodeLabel()'s returned string, but it's simpler
* than adding "do_translate" flags to this func (and labelfunc() as well). */
STRNCPY(node->name, DATA_(ntype->ui_name));
STRNCPY_UTF8(node->name, DATA_(ntype->ui_name));
nodeUniqueName(ntree, node);
/* Generally sockets should be added after the initialization, because the set of sockets might
+1 -1
View File
@@ -65,7 +65,7 @@ ShaderFxData *BKE_shaderfx_new(int type)
ShaderFxData *fx = MEM_callocN(fxi->struct_size, fxi->struct_name);
/* NOTE: this name must be made unique later. */
STRNCPY(fx->name, DATA_(fxi->name));
STRNCPY_UTF8(fx->name, DATA_(fxi->name));
fx->type = type;
fx->mode = eShaderFxMode_Realtime | eShaderFxMode_Render;
@@ -11,6 +11,7 @@
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
@@ -812,7 +813,7 @@ void blo_do_versions_userdef(UserDef *userdef)
"Versioning user script path");
STRNCPY(script_dir->dir_path, userdef->pythondir_legacy);
STRNCPY(script_dir->name, DATA_("Untitled"));
STRNCPY_UTF8(script_dir->name, DATA_("Untitled"));
BLI_addhead(&userdef->script_directories, script_dir);
}
}
@@ -368,7 +368,7 @@ static void acf_generic_idblock_name(bAnimListElem *ale, char *name)
/* just copy the name... */
if (id && name) {
BLI_strncpy(name, id->name + 2, ANIM_CHAN_NAME_SIZE);
BLI_strncpy_utf8(name, id->name + 2, ANIM_CHAN_NAME_SIZE);
}
}
@@ -476,7 +476,7 @@ static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float ymi
static void acf_summary_name(bAnimListElem *UNUSED(ale), char *name)
{
if (name) {
BLI_strncpy(name, IFACE_("Summary"), ANIM_CHAN_NAME_SIZE);
BLI_strncpy_utf8(name, IFACE_("Summary"), ANIM_CHAN_NAME_SIZE);
}
}
@@ -1178,7 +1178,7 @@ static void acf_nla_controls_backdrop(bAnimContext *ac,
/* name for nla controls expander entries */
static void acf_nla_controls_name(bAnimListElem *UNUSED(ale), char *name)
{
BLI_strncpy(name, IFACE_("NLA Strip Controls"), ANIM_CHAN_NAME_SIZE);
BLI_strncpy_utf8(name, IFACE_("NLA Strip Controls"), ANIM_CHAN_NAME_SIZE);
}
/* check if some setting exists for this channel */
@@ -1393,7 +1393,7 @@ static int acf_filldrivers_icon(bAnimListElem *UNUSED(ale))
static void acf_filldrivers_name(bAnimListElem *UNUSED(ale), char *name)
{
BLI_strncpy(name, IFACE_("Drivers"), ANIM_CHAN_NAME_SIZE);
BLI_strncpy_utf8(name, IFACE_("Drivers"), ANIM_CHAN_NAME_SIZE);
}
/* check if some setting exists for this channel */
@@ -3937,11 +3937,11 @@ static void ui_but_update_ex(uiBut *but, const bool validate)
(void)str; /* UNUSED */
}
else {
STRNCPY(but->drawstr, IFACE_("Press a key"));
STRNCPY_UTF8(but->drawstr, IFACE_("Press a key"));
}
}
else {
STRNCPY(but->drawstr, but->str);
STRNCPY_UTF8(but->drawstr, but->str);
}
break;
+2 -1
View File
@@ -36,6 +36,7 @@
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BLI_vector.hh"
@@ -2021,7 +2022,7 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op)
BKE_nlatrack_add_strip(nlt, strip, is_liboverride);
/* Auto-name the strip, and give the track an interesting name. */
STRNCPY(nlt->name, DATA_("SoundTrack"));
STRNCPY_UTF8(nlt->name, DATA_("SoundTrack"));
BKE_nlastrip_validate_name(adt, strip);
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, nullptr);
+1 -1
View File
@@ -249,7 +249,7 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(
}
if (count == 1) {
STRNCPY(title, IFACE_("Unpack 1 File"));
STRNCPY_UTF8(title, IFACE_("Unpack 1 File"));
}
else {
SNPRINTF(title, IFACE_("Unpack %d Files"), count);
+13 -12
View File
@@ -25,6 +25,7 @@
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_timecode.h"
#include "BLI_utildefines.h"
@@ -748,18 +749,18 @@ void ED_info_draw_stats(
};
char labels[MAX_LABELS_COUNT][64];
STRNCPY(labels[OBJ], IFACE_("Objects"));
STRNCPY(labels[VERTS], IFACE_("Vertices"));
STRNCPY(labels[EDGES], IFACE_("Edges"));
STRNCPY(labels[FACES], IFACE_("Faces"));
STRNCPY(labels[TRIS], IFACE_("Triangles"));
STRNCPY(labels[JOINTS], IFACE_("Joints"));
STRNCPY(labels[BONES], IFACE_("Bones"));
STRNCPY(labels[LAYERS], IFACE_("Layers"));
STRNCPY(labels[FRAMES], IFACE_("Frames"));
STRNCPY(labels[STROKES], IFACE_("Strokes"));
STRNCPY(labels[POINTS], IFACE_("Points"));
STRNCPY(labels[LIGHTS], IFACE_("Lights"));
STRNCPY_UTF8(labels[OBJ], IFACE_("Objects"));
STRNCPY_UTF8(labels[VERTS], IFACE_("Vertices"));
STRNCPY_UTF8(labels[EDGES], IFACE_("Edges"));
STRNCPY_UTF8(labels[FACES], IFACE_("Faces"));
STRNCPY_UTF8(labels[TRIS], IFACE_("Triangles"));
STRNCPY_UTF8(labels[JOINTS], IFACE_("Joints"));
STRNCPY_UTF8(labels[BONES], IFACE_("Bones"));
STRNCPY_UTF8(labels[LAYERS], IFACE_("Layers"));
STRNCPY_UTF8(labels[FRAMES], IFACE_("Frames"));
STRNCPY_UTF8(labels[STROKES], IFACE_("Strokes"));
STRNCPY_UTF8(labels[POINTS], IFACE_("Points"));
STRNCPY_UTF8(labels[LIGHTS], IFACE_("Lights"));
int longest_label = 0;
int i;
@@ -31,6 +31,8 @@
#include "BKE_workspace.h"
#include "BLI_set.hh"
#include "BLI_string_utf8.h"
#include "BLT_translation.h"
#include "DEG_depsgraph.h"
@@ -507,7 +509,7 @@ void ED_node_shader_default(const bContext *C, ID *id)
ma->nodetree = ntreeCopyTree(bmain, ma_default->nodetree);
ma->nodetree->owner_id = &ma->id;
for (bNode *node_iter : ma->nodetree->all_nodes()) {
STRNCPY(node_iter->name, DATA_(node_iter->name));
STRNCPY_UTF8(node_iter->name, DATA_(node_iter->name));
nodeUniqueName(ma->nodetree, node_iter);
}
@@ -16,6 +16,7 @@
#include "BLI_array.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_vector.hh"
#include "BLT_translation.h"
@@ -474,14 +475,14 @@ static void ui_node_sock_name(const bNodeTree *ntree,
name, UI_MAX_NAME_STR, "%s | %s", IFACE_(node_name), IFACE_(sock->link->fromsock->name));
}
else {
BLI_strncpy(name, IFACE_(node_name), UI_MAX_NAME_STR);
BLI_strncpy_utf8(name, IFACE_(node_name), UI_MAX_NAME_STR);
}
}
else if (sock->type == SOCK_SHADER) {
BLI_strncpy(name, IFACE_("None"), UI_MAX_NAME_STR);
BLI_strncpy_utf8(name, IFACE_("None"), UI_MAX_NAME_STR);
}
else {
BLI_strncpy(name, IFACE_("Default"), UI_MAX_NAME_STR);
BLI_strncpy_utf8(name, IFACE_("Default"), UI_MAX_NAME_STR);
}
}
@@ -604,7 +605,7 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname)
icon = ICON_BLANK1;
}
else {
STRNCPY(name, IFACE_(item.node_name));
STRNCPY_UTF8(name, IFACE_(item.node_name));
icon = ICON_NONE;
}
@@ -1327,7 +1327,7 @@ void calculatePropRatio(TransInfo *t)
}
if (pet_id) {
STRNCPY(t->proptext, IFACE_(pet_id));
STRNCPY_UTF8(t->proptext, IFACE_(pet_id));
}
}
else {
@@ -11,6 +11,7 @@
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "DNA_defaults.h"
#include "DNA_gpencil_legacy_types.h"
@@ -57,7 +58,7 @@ static void initData(GpencilModifierData *md)
DashGpencilModifierSegment *ds = DNA_struct_default_alloc(DashGpencilModifierSegment);
ds->dmd = dmd;
STRNCPY(ds->name, DATA_("Segment"));
STRNCPY_UTF8(ds->name, DATA_("Segment"));
dmd->segments = ds;
}
@@ -14,6 +14,7 @@
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
@@ -58,7 +59,7 @@ static void initData(GpencilModifierData *md)
MEMCPY_STRUCT_AFTER(gpmd, DNA_struct_default_get(TimeGpencilModifierData), modifier);
TimeGpencilModifierSegment *ds = DNA_struct_default_alloc(TimeGpencilModifierSegment);
ds->gpmd = gpmd;
STRNCPY(ds->name, DATA_("Segment"));
STRNCPY_UTF8(ds->name, DATA_("Segment"));
gpmd->segments = ds;
}
@@ -7,6 +7,8 @@
#include "BLT_translation.h"
#include "BLI_string_utf8.h"
#include "DNA_mask_types.h"
#include "UI_interface.h"
@@ -44,12 +46,7 @@ static void node_mask_label(const bNodeTree * /*ntree*/,
char *label,
int label_maxncpy)
{
if (node->id != nullptr) {
BLI_strncpy(label, node->id->name + 2, label_maxncpy);
}
else {
BLI_strncpy(label, IFACE_("Mask"), label_maxncpy);
}
BLI_strncpy_utf8(label, node->id ? node->id->name + 2 : IFACE_("Mask"), label_maxncpy);
}
static void node_composit_buts_mask(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -7,6 +7,8 @@
#include "BLT_translation.h"
#include "BLI_string_utf8.h"
#include "BKE_context.h"
#include "BKE_lib_id.h"
#include "BKE_tracking.h"
@@ -31,10 +33,10 @@ static void cmp_node_moviedistortion_declare(NodeDeclarationBuilder &b)
static void label(const bNodeTree * /*ntree*/, const bNode *node, char *label, int label_maxncpy)
{
if (node->custom1 == 0) {
BLI_strncpy(label, IFACE_("Undistortion"), label_maxncpy);
BLI_strncpy_utf8(label, IFACE_("Undistortion"), label_maxncpy);
}
else {
BLI_strncpy(label, IFACE_("Distortion"), label_maxncpy);
BLI_strncpy_utf8(label, IFACE_("Distortion"), label_maxncpy);
}
}
@@ -2,6 +2,7 @@
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "RNA_enum_types.h"
@@ -44,7 +45,7 @@ static void node_label(const bNodeTree * /*tree*/,
if (!enum_label) {
name = "Unknown";
}
BLI_strncpy(label, IFACE_(name), label_maxncpy);
BLI_strncpy_utf8(label, IFACE_(name), label_maxncpy);
}
static void node_gather_link_searches(GatherLinkSearchOpParams &params)
@@ -5,6 +5,7 @@
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "UI_interface.h"
#include "UI_resources.h"
@@ -184,7 +185,7 @@ static void node_label(const bNodeTree * /*tree*/,
if (!enum_label) {
name = "Unknown";
}
BLI_strncpy(label, IFACE_(name), label_maxncpy);
BLI_strncpy_utf8(label, IFACE_(name), label_maxncpy);
}
static float component_average(float3 a)
@@ -4,6 +4,7 @@
#include "BLI_noise.hh"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "RNA_enum_types.h"
@@ -36,7 +37,7 @@ static void node_label(const bNodeTree * /*tree*/,
if (!enum_label) {
name = "Unknown";
}
BLI_strncpy(label, IFACE_(name), label_maxncpy);
BLI_strncpy_utf8(label, IFACE_(name), label_maxncpy);
}
static const mf::MultiFunction *get_multi_function(const bNode &bnode)
+5 -4
View File
@@ -13,6 +13,7 @@
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
@@ -185,7 +186,7 @@ void node_blend_label(const bNodeTree * /*ntree*/,
if (!enum_label) {
name = "Unknown";
}
BLI_strncpy(label, IFACE_(name), label_maxncpy);
BLI_strncpy_utf8(label, IFACE_(name), label_maxncpy);
}
void node_image_label(const bNodeTree * /*ntree*/,
@@ -208,7 +209,7 @@ void node_math_label(const bNodeTree * /*ntree*/,
if (!enum_label) {
name = "Unknown";
}
BLI_strncpy(label, CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, name), label_maxncpy);
BLI_strncpy_utf8(label, CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, name), label_maxncpy);
}
void node_vector_math_label(const bNodeTree * /*ntree*/,
@@ -221,7 +222,7 @@ void node_vector_math_label(const bNodeTree * /*ntree*/,
if (!enum_label) {
name = "Unknown";
}
BLI_strncpy(label, IFACE_(name), label_maxncpy);
BLI_strncpy_utf8(label, IFACE_(name), label_maxncpy);
}
void node_filter_label(const bNodeTree * /*ntree*/,
@@ -234,7 +235,7 @@ void node_filter_label(const bNodeTree * /*ntree*/,
if (!enum_label) {
name = "Unknown";
}
BLI_strncpy(label, IFACE_(name), label_maxncpy);
BLI_strncpy_utf8(label, IFACE_(name), label_maxncpy);
}
void node_combsep_color_label(const ListBase *sockets, NodeCombSepColorMode mode)
@@ -86,7 +86,7 @@ static void sh_node_mix_label(const bNodeTree * /*ntree*/,
if (!enum_label) {
name = "Unknown";
}
BLI_strncpy(label, IFACE_(name), label_maxncpy);
BLI_strncpy_utf8(label, IFACE_(name), label_maxncpy);
}
}