replace strncpy with BLI_strncpy, in some cases strncpy was being misused since it doesnt ensure \0 termination.

also dont call CTX_data_scene() twice when checking for function arguments.
This commit is contained in:
2011-09-26 18:51:10 +00:00
parent e897c8e83e
commit 58587a3881
30 changed files with 79 additions and 68 deletions

View File

@@ -120,7 +120,7 @@ PyObject *bpy_text_import(Text *text)
}
len= strlen(text->id.name+2);
strncpy(modulename, text->id.name+2, len);
BLI_strncpy(modulename, text->id.name+2, len);
modulename[len - 3]= '\0'; /* remove .py */
return PyImport_ExecCodeModule(modulename, text->compiled);
}