diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-15 19:24:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-15 19:24:57 +0400 |
commit | f403d9a2b1128565c503755668c7bc001ecb2eb3 (patch) | |
tree | a10b457b0b64f104c815229c2804f2b78d28d696 /source/blender/makesrna/intern/rna_ui.c | |
parent | db8024f4b54ac4cf83b5346fe1548c009fd21082 (diff) |
replace rna description string limits with rna define RNA_DYN_DESCR_MAX
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 1ad9cb00ba1..be0fec41aa1 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -413,7 +413,7 @@ static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type) WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); } -static char _menu_descr[1024]; +static char _menu_descr[RNA_DYN_DESCR_MAX]; static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { @@ -490,7 +490,7 @@ static void rna_Menu_bl_description_set(PointerRNA *ptr, const char *value) { Menu *data= (Menu*)(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 menu"); } @@ -830,7 +830,7 @@ static void rna_def_menu(BlenderRNA *brna) 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_Menu_bl_description_set"); // RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); |