gluster / gluster-block

A framework for gluster block storage
GNU General Public License v2.0
74 stars 32 forks source link

genconfig: fix one compile warning #254

Closed lxbsz closed 4 years ago

lxbsz commented 4 years ago

block_genconfig.c: In function 'block_gen_config_cli_1_svc': block_genconfig.c:66:43: warning: '%s' directive output may be truncated writing up to 255 bytes into a region of size 239 [-Wformat-truncation=] 66 | snprintf(lun_so, 256, "/backstores/user/%s", block); | ^~ In file included from /usr/include/stdio.h:867, from ../utils/utils.h:16, from ../utils/common.h:15, from block_common.h:16, from block_genconfig.c:12: /usr/include/bits/stdio2.h:67:10: note: 'builtin___snprintf_chk' output between 18 and 273 bytes into a destination of size 256 67 | return builtin_snprintf_chk (s, n, USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~ 68 | bos (s), fmt, va_arg_pack ()); | ~~~~~~~~~

Signed-off-by: Xiubo Li xiubli@redhat.com

What does this PR achieve? Why do we need it?

Does this PR fix issues?

Fixes: #

Notes for the reviewer

pkalever commented 4 years ago

@lxbsz merged now. Thanks!