Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-11-15 19:24:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-15 19:24:57 +0400
commitf403d9a2b1128565c503755668c7bc001ecb2eb3 (patch)
treea10b457b0b64f104c815229c2804f2b78d28d696 /source/blender/makesrna/intern/rna_wm.c
parentdb8024f4b54ac4cf83b5346fe1548c009fd21082 (diff)
replace rna description string limits with rna define RNA_DYN_DESCR_MAX
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 7e55c832f3f..8e05e43b48f 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -966,7 +966,7 @@ void macro_wrapper(wmOperatorType *ot, void *userdata);
static char _operator_idname[OP_MAX_TYPENAME];
static char _operator_name[OP_MAX_TYPENAME];
-static char _operator_descr[1024];
+static char _operator_descr[RNA_DYN_DESCR_MAX];
static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
wmOperatorType dummyot = {NULL};
@@ -1161,7 +1161,7 @@ static void rna_Operator_bl_idname_set(PointerRNA *ptr, const char *value)
{
wmOperator *data= (wmOperator*)(ptr->data);
char *str= (char *)data->type->idname;
- if(!str[0]) strcpy(str, value);
+ if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_idname on a non-builtin operator");
}
@@ -1169,7 +1169,7 @@ static void rna_Operator_bl_label_set(PointerRNA *ptr, const char *value)
{
wmOperator *data= (wmOperator*)(ptr->data);
char *str= (char *)data->type->name;
- if(!str[0]) strcpy(str, value);
+ if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_label on a non-builtin operator");
}
@@ -1177,7 +1177,7 @@ static void rna_Operator_bl_description_set(PointerRNA *ptr, const char *value)
{
wmOperator *data= (wmOperator*)(ptr->data);
char *str= (char *)data->type->description;
- if(!str[0]) strcpy(str, value);
+ if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_description on a non-builtin operator");
}
@@ -1232,14 +1232,14 @@ static void rna_def_operator(BlenderRNA *brna)
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
- RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set");
// RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER);
prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
- RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set");
// RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
@@ -1293,14 +1293,14 @@ static void rna_def_macro_operator(BlenderRNA *brna)
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
- RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set");
// RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER);
prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
- RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set");
// RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);