From: Hector Cao Date: Thu, 28 May 2026 07:13:51 +0000 (+0200) Subject: preserve const-ness when calling strrchr() X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fcollectd.git preserve const-ness when calling strrchr() strrchr() preserves the const-ness of the argument, the argument is a const char* so the return value should also be a const. --- diff --git a/src/dpdkstat.c b/src/dpdkstat.c index ae93e53b2..58abbe4e4 100644 --- a/src/dpdkstat.c +++ b/src/dpdkstat.c @@ -310,7 +310,7 @@ int dpdk_helper_command_handler(dpdk_helper_ctx_t *phc, enum DPDK_CMD cmd) { static void dpdk_stats_resolve_cnt_type(char *cnt_type, size_t cnt_type_len, const char *cnt_name) { - char *type_end; + const char *type_end; type_end = strrchr(cnt_name, '_'); if ((type_end != NULL) && (strncmp(cnt_name, "rx_", strlen("rx_")) == 0)) {