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-12-06 02:50:55 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-06 02:50:55 +0300
commit2f366d1544ecc5618d7190b779ccc75f2f144d0a (patch)
tree699c5b52c7f8768bd46720b1824bee3565e2dff9 /source/blender/makesrna/intern/rna_ID.c
parent9668c29ba00ed830109665ea132b6292cdfe9e2a (diff)
use BLI_strnlen rather then strlen when comparing against fixed lengths.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 63a2c5d41d4..076669fc1ec 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -223,8 +223,8 @@ StructRNA *rna_IDPropertyGroup_register(const bContext *C, ReportList *reports,
* just a char pointer, but take care here, also be careful that python
* owns the string pointer which it could potentually free while blender
* is running. */
- if(strlen(identifier) >= sizeof(((IDProperty *)NULL)->name)) {
- BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(((IDProperty *)NULL)->name));
+ if(BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) {
+ BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME) ".", identifier);
return NULL;
}