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/python/generic/IDProp.c
parent9668c29ba00ed830109665ea132b6292cdfe9e2a (diff)
use BLI_strnlen rather then strlen when comparing against fixed lengths.
Diffstat (limited to 'source/blender/python/generic/IDProp.c')
-rw-r--r--source/blender/python/generic/IDProp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c
index 1346325e892..cb98ed0fd6b 100644
--- a/source/blender/python/generic/IDProp.c
+++ b/source/blender/python/generic/IDProp.c
@@ -23,9 +23,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include "IDProp.h"
+
#include "BKE_idprop.h"
#include "BKE_utildefines.h"
-#include "IDProp.h"
+#include "BLI_string.h"
#include "MEM_guardedalloc.h"
#define USE_STRING_COERCE
@@ -192,7 +194,7 @@ static int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value, void *UNUS
}
st = _PyUnicode_AsString(value);
- if (strlen(st) >= MAX_IDPROP_NAME) {
+ if (BLI_strnlen(st, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) {
PyErr_SetString(PyExc_TypeError, "string length cannot exceed 31 characters!");
return -1;
}