[dpdk-dev] [PATCH v3 2/2] rte_metrics: fix strncpy truncation warning

Thomas Monjalon thomas at monjalon.net
Wed Apr 4 16:33:03 CEST 2018


29/03/2018 19:05, Stephen Hemminger:
> Fixes:
> librte_metrics/rte_metrics.c:218:4: error: ‘strncpy’ specified
>  bound 64 equals destination size [-Werror=stringop-truncation]
>     strncpy(names[idx_name].name,
>     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>      stats->metadata[idx_name].name,
>      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>      RTE_METRICS_MAX_NAME_LEN);
>      ~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>

This one is fixed with strlcpy now.





More information about the dev mailing list