]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
api: Fix clang warning
authorTom Hromatka <tom.hromatka@oracle.com>
Tue, 29 Jul 2025 16:01:54 +0000 (16:01 +0000)
committerKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 1 Aug 2025 09:02:21 +0000 (14:32 +0530)
Fix the following warning by simply deleting the line.  The variable
path_dir_end is not used after this line, and thus does not need to be
set.

api.c:2384:19: warning: expression which evaluates to zero treated as a
null pointer constant of type 'char *' [-Wnon-literal-null-conversion]
 2384 |                         path_dir_end = '\0';

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
src/api.c

index 2b539acd0b872860f39b2778ae7e3223c09a41a4..0a9f847a0efa66b1161f3c31be2f31882f23d1bc 100644 (file)
--- a/src/api.c
+++ b/src/api.c
@@ -2381,7 +2381,6 @@ static int cg_set_control_value(char *path, const char *val)
                        path_dir_end = strrchr(path, '/');
                        if (path_dir_end == NULL)
                                return ECGROUPVALUENOTEXIST;
-                       path_dir_end = '\0';
 
                        /* task_path contain: $path/tasks */
                        tasks_path = (char *)malloc(strlen(path) + 6 + 1);