aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre
diff options
context:
space:
mode:
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>2014-09-14 18:03:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-14 10:05:11 -0700
commit3f2882d3696876c9458c794fa960f5c3133d70a5 (patch)
tree62954097cb1ed9bc66c932f61abba4ca8feaa270 /drivers/staging/lustre
parentStaging: lustre: lustre: mdc: mdc_request: Removed useless variable (diff)
downloadlinux-dev-3f2882d3696876c9458c794fa960f5c3133d70a5.tar.xz
linux-dev-3f2882d3696876c9458c794fa960f5c3133d70a5.zip
staging: lustre: Cleaning up unnecessary use of memset in conjunction with strncpy
Using memset before strncpy just to ensure a trailing null character is an unnecessary double writing of a string Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r--drivers/staging/lustre/lustre/libcfs/debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c
index 48c5d5512235..ba43b3067fa3 100644
--- a/drivers/staging/lustre/lustre/libcfs/debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/debug.c
@@ -401,9 +401,9 @@ int libcfs_debug_init(unsigned long bufsize)
}
if (libcfs_debug_file_path != NULL) {
- memset(libcfs_debug_file_path_arr, 0, PATH_MAX);
strncpy(libcfs_debug_file_path_arr,
libcfs_debug_file_path, PATH_MAX-1);
+ libcfs_debug_file_path_arr[PATH_MAX - 1] = '\0';
}
/* If libcfs_debug_mb is set to an invalid value or uninitialized