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>2010-11-05 10:35:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-05 10:35:21 +0300
commite179c92a278160ad3a1523a17ef272f6f3547f46 (patch)
tree743ba7ec0ac67b6afc202cdd7a5d063d6ee617ae /source/blender/makesrna
parent0ebdbdac00fda4ceb7f8a53e3b944575a8d76133 (diff)
tedious string copying changes
- use sizeof() in more places. - fixed some off by 1 bugs copying strings. setting curve font family for instance was 1 char too short. - replace strncpy and strcpy with BLI_strncpy
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_controller.c1
-rw-r--r--source/blender/makesrna/intern/rna_curve.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c
index ee0707ad0ae..73ac46e8e78 100644
--- a/source/blender/makesrna/intern/rna_controller.c
+++ b/source/blender/makesrna/intern/rna_controller.c
@@ -207,7 +207,6 @@ void RNA_def_controller(BlenderRNA *brna)
prop= RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "str");
- RNA_def_property_string_maxlength(prop, 127);
RNA_def_property_ui_text(prop, "Expression", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 7983b8f8a7f..c7802de9ebb 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -844,7 +844,7 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
/* strings */
prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE);
- RNA_def_property_string_maxlength(prop, 21);
+ RNA_def_property_string_maxlength(prop, (sizeof((ID *)NULL)->name)-2);
RNA_def_property_ui_text(prop, "Object Font", "Use Blender Objects as font characters. Give font objects a common name followed by the character it represents, eg. familya, familyb etc, and turn on Verts Duplication");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");