From: Tom Hromatka Date: Tue, 29 Jul 2025 16:09:05 +0000 (+0000) Subject: api: Fix clang warning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5218bdbb6d49d558f8de6e5204f5afed9999282;p=thirdparty%2Flibcgroup.git api: Fix clang warning Fix the following clang warnings by initializing the char pointers to NULL rather than '\0'; api.c:4232:46: warning: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Wnon-literal-null-conversion] 4232 | char *controller_list[MAX_MNT_ELEMENTS] = { '\0' }; | ^~~~ api.c:4233:40: warning: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Wnon-literal-null-conversion] 4233 | char *cgrp_list[MAX_MNT_ELEMENTS] = { '\0' }; | ^~~~ Signed-off-by: Tom Hromatka Signed-off-by: Kamalesh Babulal --- diff --git a/src/api.c b/src/api.c index c2f07fc3..234c5b4d 100644 --- a/src/api.c +++ b/src/api.c @@ -4229,8 +4229,8 @@ static bool cgroup_is_rt_task(const pid_t pid) STATIC bool cgroup_compare_ignore_rule(const struct cgroup_rule * const rule, pid_t pid, const char * const procname) { - char *controller_list[MAX_MNT_ELEMENTS] = { '\0' }; - char *cgrp_list[MAX_MNT_ELEMENTS] = { '\0' }; + char *controller_list[MAX_MNT_ELEMENTS] = { NULL }; + char *cgrp_list[MAX_MNT_ELEMENTS] = { NULL }; int rule_matching_controller_idx; int cgrp_list_matching_idx = 0; bool found_match = false;