From 4db1c9c61425dd7d2f8b99a33b004aa345b24f68 Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Mon, 3 Apr 2017 09:29:33 +0530 Subject: [PATCH] =?utf8?q?tools:=20warning,=20=E2=80=98%.16x=E2=80=99=20di?= =?utf8?q?rective=20output=20truncated=20writing=2016=20bytes=20into=20a?= =?utf8?q?=20region=20of=20size=209.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The following warning appears during make. radosacl.cc:122:5: warning: ‘%.16x’ directive output truncated writing 16 bytes into a region of size 9 [-Wformat-truncation=] int main(int argc, const char **argv) ^~~~ from ./src/tools/radosacl.cc:19: /usr/include/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output 17 bytes into a destination of size 9 __bos (__s), __fmt, __va_arg_pack ()); Signed-off-by: Jos Collin --- src/tools/radosacl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/radosacl.cc b/src/tools/radosacl.cc index 1eddef915ca2b..882af2cae7e44 100644 --- a/src/tools/radosacl.cc +++ b/src/tools/radosacl.cc @@ -151,7 +151,7 @@ int main(int argc, const char **argv) ACLID id; - snprintf(id.id, ID_SIZE + 1, "%.16x", 0x1234); + snprintf(id.id, sizeof(id.id), "%.8x", 0x1234); cout << "id=" << id.id << std::endl; r = io_ctx.exec(oid, "acl", "get", bl, bl2); -- 2.39.5