From: Tom Hromatka Date: Mon, 12 Apr 2021 15:25:00 +0000 (-0600) Subject: wrapper.c: Fix fprintf argument warning X-Git-Tag: v2.0.rc1~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fdb521bb926c29e7354627ebf634c7803edef2e;p=thirdparty%2Flibcgroup.git wrapper.c: Fix fprintf argument warning 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 --- 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;