From 1fdb521bb926c29e7354627ebf634c7803edef2e Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Mon, 12 Apr 2021 09:25:00 -0600 Subject: [PATCH] wrapper.c: Fix fprintf argument warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wrapper.c b/src/wrapper.c index 966cb849..98ebcc26 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.47.2