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 <campbell@blender.org>2022-09-10 09:51:15 +0300
committerCampbell Barton <campbell@blender.org>2022-09-10 09:54:21 +0300
commit8cb3b49e51469b9689bfa44b85349149e17699dc (patch)
tree04307341165e0ee87aca82190c760af241027c32 /source/blender/editors/screen/area.c
parent489cb7fd7eb0ab4e34c084acd2bf740a878498e9 (diff)
Cleanup: replace strncpy with BLI_strncpy
Also replace strncpy+strcat with BLI_string_join
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r--source/blender/editors/screen/area.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index dc3aaea5e49..4e99e384f9f 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -16,6 +16,7 @@
#include "BLI_linklist_stack.h"
#include "BLI_math.h"
#include "BLI_rand.h"
+#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
@@ -2687,12 +2688,13 @@ static void ed_panel_draw(const bContext *C,
const uiStyle *style = UI_style_get_dpi();
/* Draw panel. */
-
char block_name[BKE_ST_MAXNAME + INSTANCED_PANEL_UNIQUE_STR_LEN];
- strncpy(block_name, pt->idname, BKE_ST_MAXNAME);
- if (unique_panel_str != NULL) {
+ if (unique_panel_str) {
/* Instanced panels should have already been added at this point. */
- strncat(block_name, unique_panel_str, INSTANCED_PANEL_UNIQUE_STR_LEN);
+ BLI_string_join(block_name, sizeof(block_name), pt->idname, unique_panel_str);
+ }
+ else {
+ STRNCPY(block_name, pt->idname);
}
uiBlock *block = UI_block_begin(C, region, block_name, UI_EMBOSS);