Fix wrong buffer size passed to snprintf, use BLI_snprintf

Also remove redundant call to snprintf.
This commit is contained in:
Campbell Barton
2023-05-23 12:46:55 +10:00
parent 9357f7b606
commit 8d2679e1c5
2 changed files with 1 additions and 2 deletions

View File

@@ -571,7 +571,6 @@ static void nla_fmodifier_panel_id(void *fcm_link, char *r_name)
{
FModifier *fcm = (FModifier *)fcm_link;
eFModifier_Types type = fcm->type;
snprintf(r_name, BKE_ST_MAXNAME, "%s_PT_", NLA_FMODIFIER_PANEL_PREFIX);
const FModifierTypeInfo *fmi = get_fmodifier_typeinfo(type);
BLI_snprintf(r_name, BKE_ST_MAXNAME, "%s_PT_%s", NLA_FMODIFIER_PANEL_PREFIX, fmi->name);
}

View File

@@ -224,7 +224,7 @@ static void panel_draw(const bContext * /*C*/, Panel *panel)
int decimate_type = RNA_enum_get(ptr, "decimate_type");
char count_info[64];
snprintf(count_info, 32, TIP_("Face Count: %d"), RNA_int_get(ptr, "face_count"));
SNPRINTF(count_info, TIP_("Face Count: %d"), RNA_int_get(ptr, "face_count"));
uiItemR(layout, ptr, "decimate_type", UI_ITEM_R_EXPAND, nullptr, ICON_NONE);