diff options
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 43b2db0d62c..8759d7a0e5f 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1501,7 +1501,8 @@ char *txt_sel_to_buf(Text *text, size_t *r_buf_strlen) if (linef == linel) { length = charl - charf; buf = MEM_mallocN(length + 1, "sel buffer"); - memcpy(buf, linef->line + charf, length + 1); + memcpy(buf, linef->line + charf, length); + buf[length] = '\0'; } else { /* Add 1 for the '\n' */ |