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>2013-03-14 15:29:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-14 15:29:15 +0400
commit63d3594975cde6fd80e503fd433dab6ac3f6223a (patch)
treec0837273cbbcd807cd228029ac018b8f1746a448
parentffc8ecc5874931e7a0040141a7bc3ad1b70b17d0 (diff)
ui_def_but() allocating an extra byte in 'but->str' for no reason.
-rw-r--r--source/blender/editors/interface/interface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 20233a67775..4f0d788d733 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2746,8 +2746,8 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
but->retval = retval;
slen = strlen(str);
- if (slen >= UI_MAX_NAME_STR - 1) {
- but->str = MEM_mallocN(slen + 2, "ui_def_but str"); /* why +2 ? */
+ if (slen >= UI_MAX_NAME_STR) {
+ but->str = MEM_mallocN(slen + 1, "ui_def_but str");
}
else {
but->str = but->strdata;