summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/src/fuse-helpers.c
diff options
context:
space:
mode:
authorKaleb S. KEITHLE <kkeithle@redhat.com>2018-11-09 11:27:11 -0500
committerAmar Tumballi <amarts@redhat.com>2018-11-15 05:05:34 +0000
commit76906af9d70fc784de728a70e3dbda62dece5e10 (patch)
tree6f5128c78611e91cf5e6ade8a166802a9720567b /xlators/mount/fuse/src/fuse-helpers.c
parent8a5adc811637b147e6e42d952498bc99e3d670bb (diff)
core: fix strncpy warnings
Since gcc-8.2.x (fedora-28 or so) gcc has been emitting warnings about buggy use of strncpy. e.g. warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length and warning: ‘strncpy’ specified bound depends on the length of the source argument Since we're copying string fragments and explicitly null terminating use memcpy to silence the warning Change-Id: I413d84b5f4157f15c99e9af3e154ce594d5bcdc1 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/mount/fuse/src/fuse-helpers.c')
-rw-r--r--xlators/mount/fuse/src/fuse-helpers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/mount/fuse/src/fuse-helpers.c b/xlators/mount/fuse/src/fuse-helpers.c
index 2145a951c4e..cf4f8e17c51 100644
--- a/xlators/mount/fuse/src/fuse-helpers.c
+++ b/xlators/mount/fuse/src/fuse-helpers.c
@@ -534,7 +534,7 @@ gf_fuse_fill_dirent(gf_dirent_t *entry, struct fuse_dirent *fde,
fde->off = entry->d_off;
fde->type = entry->d_type;
fde->namelen = strlen(entry->d_name);
- strncpy(fde->name, entry->d_name, fde->namelen);
+ (void)memcpy(fde->name, entry->d_name, fde->namelen);
}
static int