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:
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 9657347a1c4..6da9c13d1cf 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -140,13 +140,13 @@ void WM_operator_bl_idname(char *to, const char *from)
if (from) {
const char *sep = strchr(from, '.');
- if (sep) {
- int ofs = (sep - from);
-
+ int from_len;
+ if (sep && (from_len = strlen(from)) < OP_MAX_TYPENAME - 3) {
+ const int ofs = (sep - from);
memcpy(to, from, sizeof(char) * ofs);
BLI_str_toupper_ascii(to, ofs);
- strcpy(to + ofs, "_OT_");
- strcpy(to + (ofs + 4), sep + 1);
+ memcpy(to + ofs, "_OT_", 4);
+ memcpy(to + (ofs + 4), sep + 1, (from_len - ofs));
}
else {
/* should not happen but support just in case */