diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-12 19:54:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-12 19:54:24 +0300 |
commit | 55f68c36574779ae2fac3652466584628b22c633 (patch) | |
tree | e2f55301dda8897bf17f8b8459229d8fa5a67816 /source/creator | |
parent | 9eee1f962d49f14d92c8da4e677e4ee140f4f440 (diff) |
fix for more warnings.
- modifier code was using sizeof() without knowing the sizeof the array when clearing the modifier type array.
- use BLI_snprintf rather then sprintf where the size of the string is known.
- particle drawing code kept a reference to stack float values (not a problem at the moment but would crash if accessed later).
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/creator.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 730563dfc63..215dd356b7b 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -932,9 +932,10 @@ static int set_addons(int argc, char **argv, void *data) /* workaround for scripts not getting a bpy.context.scene, causes internal errors elsewhere */ if (argc > 1) { #ifdef WITH_PYTHON - char *str= malloc(strlen(argv[1]) + 100); + const int slen= strlen(argv[1]) + 10; + char *str= malloc(slen); bContext *C= data; - sprintf(str, "[__import__('bpy').utils.addon_enable(i) for i in '%s'.split(',')]", argv[1]); + BLI_snprintf(str, slen, "[__import__('bpy').utils.addon_enable(i) for i in '%s'.split(',')]", argv[1]); BPY_CTX_SETUP(BPY_string_exec(C, str)); free(str); #else |