fix: warning '-Wstringop-truncation' with GCC 11.2
[lttng-tools.git] / tests / unit / test_ust_data.c
index 0eeb026a19902a039d182626488a17bc7099a115..4fb4bf093b0b5142357a9743b369aa09aa963851 100644 (file)
@@ -177,9 +177,9 @@ static void test_create_ust_event_exclusion(void)
        exclusion->count = exclusion_count;
        random_name = get_random_string();
        strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion, 0), random_name,
-               LTTNG_SYMBOL_NAME_LEN);
+               LTTNG_SYMBOL_NAME_LEN - 1);
        strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion, 1), random_name,
-               LTTNG_SYMBOL_NAME_LEN);
+               LTTNG_SYMBOL_NAME_LEN - 1);
 
        ret = trace_ust_create_event(&ev, NULL, NULL, exclusion, false, &event);
        exclusion = NULL;
@@ -209,9 +209,9 @@ static void test_create_ust_event_exclusion(void)
 
        exclusion->count = exclusion_count;
        strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion, 0),
-               get_random_string(), LTTNG_SYMBOL_NAME_LEN);
+               get_random_string(), LTTNG_SYMBOL_NAME_LEN - 1);
        strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion, 1),
-               get_random_string(), LTTNG_SYMBOL_NAME_LEN);
+               get_random_string(), LTTNG_SYMBOL_NAME_LEN - 1);
 
        exclusion_copy->count = exclusion_count;
        strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion_copy, 0),
This page took 0.024721 seconds and 4 git commands to generate.