]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
preserve const-ness when calling strrchr() main
authorHector Cao <hector.cao@canonical.com>
Thu, 28 May 2026 07:13:51 +0000 (09:13 +0200)
committerMatthias Runge <mrunge@matthias-runge.de>
Fri, 29 May 2026 12:58:42 +0000 (14:58 +0200)
strrchr() preserves the const-ness of the argument, the argument is a const char*
so the return value should also be a const.

src/dpdkstat.c

index ae93e53b2d84829a9db204a0f2795fec17b398d2..58abbe4e4a1e7115a386d066835ff2eff0f4d8ce 100644 (file)
@@ -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)) {