]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
api: Fix clang warning
authorTom Hromatka <tom.hromatka@oracle.com>
Tue, 29 Jul 2025 16:13:46 +0000 (16:13 +0000)
committerKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 1 Aug 2025 09:02:21 +0000 (14:32 +0530)
Fix the following clang warning by using NULL instead of '\0'

api.c:6721:17: warning: expression which evaluates to zero treated as a
null pointer constant of type 'char *' [-Wnon-literal-null-conversion]
 6721 |         mnt_paths[i] = '\0';
      |                        ^~~~

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

index 4940e459ad68e8313addbc54528541f6d0d7ad3b..8dcaf80aa69fb4d43e0f1120977b5e6bbd7c6cca 100644 (file)
--- a/src/api.c
+++ b/src/api.c
@@ -6718,7 +6718,7 @@ int cgroup_list_mount_points(const enum cg_version_t cgrp_version, char ***mount
                        goto err;
                }
        }
-       mnt_paths[i] = '\0';
+       mnt_paths[i] = NULL;
 
        ret = 0;
        *mount_paths = mnt_paths;