]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Trival: Fix warning in strncmp
authorBalbir singh <bsingharora@gmail.com>
Mon, 19 Dec 2022 15:41:51 +0000 (08:41 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 19 Dec 2022 15:42:59 +0000 (08:42 -0700)
The name field of the structure is of a much smaller size
CONTROL_NAMELEN_MAX and not FILENAME_MAX. Listen to the
compiler and fix the issue.

Signed-off-by: Balbir singh <bsingharora@gmail.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/config.c

index de7e36179588cc9c6546542519b32a166ce44ce0..155c800dd56438201a3268f5573954abe92ed459 100644 (file)
@@ -918,7 +918,7 @@ static int config_order_namespace_table(void)
 
                for (j = 0; cg_mount_table[j].name[0] != '\0'; j++) {
                        if (strncmp(config_namespace_table[i].name, cg_mount_table[j].name,
-                                   FILENAME_MAX) == 0) {
+                                   CONTROL_NAMELEN_MAX) == 0) {
 
                                flag = 1;