]> 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:17:09 +0000 (15:17 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 8 Jan 2020 15:01:39 +0000 (08:01 -0700)
commit1eb905fec003476f9fea9990ad4c9692925defcf
tree52bc072c64363f1b7bedc65acf987b8742a807f4
parent017932c3df8b8e6dcb72643b4114c1296f801a7e
api.c: Fix string truncation warning

This commit fixes this warning in api.c:

api.c: In function ‘cgroup_read_value_begin’:
api.c:4114:47: warning: ‘snprintf’ output may be truncated before the
    last format character [-Wformat-truncation=]
    4114 |  snprintf(stat_file, sizeof(stat_file), "%s/%s", stat_path,
         |                                               ^
api.c:4114:2: note: ‘snprintf’ output 2 or more bytes (assuming 4097)
    into a destination of size 4096
    4114 |  snprintf(stat_file, sizeof(stat_file), "%s/%s", stat_path,
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    4115 |   name);
         |   ~~~~~

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