From 2f366d1544ecc5618d7190b779ccc75f2f144d0a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 5 Dec 2010 23:50:55 +0000 Subject: use BLI_strnlen rather then strlen when comparing against fixed lengths. --- source/blender/makesrna/intern/rna_ID.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern/rna_ID.c') 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; } -- cgit v1.2.3