]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: Fix string truncation warning
authorTom Hromatka <tom.hromatka@oracle.com>
Sun, 5 Jan 2020 22:13:51 +0000 (15:13 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 8 Jan 2020 15:01:39 +0000 (08:01 -0700)
commit017932c3df8b8e6dcb72643b4114c1296f801a7e
tree56d43b15ea4d259f20716844967a89be09255c55
parent687956c8fea8b063cac2e5690cd82e7776aa6c47
api.c: Fix string truncation warning

This commit fixes this warning in api.c:

api.c: In function ‘cgroup_read_stats_begin’:
api.c:4189:47: warning: ‘.stat’ directive output may be truncated
    writing 5 bytes into a region of size between 0 and 4095
    [-Wformat-truncation=]
    4189 |  snprintf(stat_file, sizeof(stat_file), "%s/%s.stat", stat_path,
         |                                               ^~~~~
api.c:4189:2: note: ‘snprintf’ output 7 or more bytes (assuming 4102)
    into a destination of size 4096
    4189 |  snprintf(stat_file, sizeof(stat_file), "%s/%s.stat", stat_path,
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    4190 |    controller);
         |    ~~~~~~~~~~~

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