From bfe2447f570ecc8b03a1ab3d3a1a1e4ed0b58312 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Dec 2010 10:17:31 +0000 Subject: partial fix [#23265] matrix_world rna path is visible but returns 0 to drivers without error however accessed this report raised a number of problems with rna paths, while we still dont have multi-dimensional array access, invalid paths were being accepted which confused things. rna path resolving code was accepting all sorts of invalid input because atoi() just returns 0 for non numeric input. now check if 0 number == '0' character. --- source/blender/makesrna/intern/rna_access.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index d8c4c67c68a..9ec21b13695 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -3047,6 +3047,9 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, else { /* otherwise do int lookup */ intkey= atoi(token); + if(intkey==0 && (token[0] != '0' || token[1] != '\0')) { + return 0; /* we can be sure the fixedbuf was used in this case */ + } RNA_property_collection_lookup_int(&curptr, prop, intkey, &nextptr); } @@ -3096,6 +3099,9 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, else { /* otherwise do int lookup */ *index= atoi(token); + if(intkey==0 && (token[0] != '0' || token[1] != '\0')) { + return 0; /* we can be sure the fixedbuf was used in this case */ + } } } else { -- cgit v1.2.3