Cleanup: add STRNLEN macros to prevent incorrect sizeof() use

Missed in recent cleanup.
This commit is contained in:
Campbell Barton
2025-04-12 13:35:43 +10:00
parent 9d5a823246
commit 0fb6cc72fd
2 changed files with 1 additions and 3 deletions

View File

@@ -1046,8 +1046,7 @@ static void legacy_gpencil_to_grease_pencil(ConversionData &conversion_data,
int layer_idx = 0;
LISTBASE_FOREACH_INDEX (bGPDlayer *, gpl, &gpd.layers, layer_idx) {
/* Create a new layer. */
Layer &new_layer = grease_pencil.add_layer(
StringRefNull(gpl->info, BLI_strnlen(gpl->info, 128)));
Layer &new_layer = grease_pencil.add_layer(StringRefNull(gpl->info, STRNLEN(gpl->info)));
/* Flags. */
new_layer.set_visible((gpl->flag & GP_LAYER_HIDE) == 0);

View File

@@ -265,5 +265,4 @@ int BLI_str_utf8_offset_from_column_with_tabs(const char *str,
#define STRNLEN_UTF8(str) BLI_strnlen_utf8(str, ARRAY_SIZE(str))
/** \} */