summaryrefslogtreecommitdiffstats
path: root/xlators/features/bit-rot/src/stub/bit-rot-stub.c
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2017-09-14 14:31:26 -0400
committerKotresh HR <khiremat@redhat.com>2017-10-04 05:44:21 +0000
commitd9cd579a38abb507726ecece8ae4447077709747 (patch)
tree408b3f56fe0079753176be0aacf33228ab102e22 /xlators/features/bit-rot/src/stub/bit-rot-stub.c
parentd1f15cdeb609a1b720a04a502f7a63b2d3922f41 (diff)
xlator/bitrot: flood of -Wformat-truncation warnings with gcc-7.1
Starting in Fedora 26 which has gcc-7.1.x, -Wformat-trunction is enabled with -Wformat, resulting in a flood of new warnings. This many warnings is a concern because it makes it hard(er) to see other warnings that should be addressed. An example is at https://kojipkgs.fedoraproject.org//packages/glusterfs/3.12.0/1.fc28/data/logs/x86_64/build.log For more info see https://review.gluster.org/#/c/18267/ Change-Id: I7792d94da1e8109f3aaa857a94be40f2d2402684 BUG: 1492851 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot/src/stub/bit-rot-stub.c')
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-stub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c
index fb187a3..10a1d81 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c
+++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c
@@ -139,9 +139,9 @@ init (xlator_t *this)
GF_OPTION_INIT ("bitrot", priv->do_versioning, bool, free_mempool);
GF_OPTION_INIT ("export", tmp, str, free_mempool);
- memcpy (priv->export, tmp, strlen (tmp) + 1);
+ strncpy (priv->export, tmp, sizeof (priv->export));
- (void) snprintf (priv->stub_basepath, PATH_MAX,
+ (void) snprintf (priv->stub_basepath, sizeof (priv->stub_basepath),
"%s/%s", priv->export, BR_STUB_QUARANTINE_DIR);
(void) gettimeofday (&tv, NULL);