]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
cgsnapshot: Fix compiler truncation warning
authorTom Hromatka <tom.hromatka@oracle.com>
Thu, 20 Jul 2023 14:24:16 +0000 (19:54 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 25 Jul 2023 18:13:28 +0000 (12:13 -0600)
commitedf59d999e38bbc9f54a51ae74b2a66a404c0c39
tree5d2a1082920ddddd3eeeacd9f796e21ef516141c
parenta66006db62b17f61ca3af531e479fe1354fbc2e7
cgsnapshot: Fix compiler truncation warning

Fix the following warning when running make distcheck

../../../../src/tools/cgsnapshot.c: In function ‘is_ctlr_on_list’:
../../../../src/tools/cgsnapshot.c:532:57: warning: ‘%s’ directive output may be truncated writing up to 409599 bytes into a region of size 4096 [-Wformat-truncation=]
532 |                 snprintf(controllers[i], FILENAME_MAX, "%s", tmp_controllers[i]);
    |                                                         ^~

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