Fix a warning in cgroup_add_value_string() where '%d' was being passed to fprintf when it should have been using '%ld'.
wrapper.c: In function ‘cgroup_add_value_string’: wrapper.c:207:51: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=] 207 | fprintf(stderr, "value exceeds the maximum of %d characters\n", | ~^ | | | int | %ld 208 | sizeof(cntl_value->value) - 1); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | long unsigned int Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com> --- src/wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wrapper.c b/src/wrapper.c index 966cb8490102..98ebcc266c41 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -204,7 +204,7 @@ int cgroup_add_value_string(struct cgroup_controller *controller, if (value) { if (strlen(value) >= sizeof(cntl_value->value)) { - fprintf(stderr, "value exceeds the maximum of %d characters\n", + fprintf(stderr, "value exceeds the maximum of %ld characters\n", sizeof(cntl_value->value) - 1); free(cntl_value); return ECGCONFIGPARSEFAIL; -- 2.26.2 _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel