diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c index 48c5d5512235b4f6717818f2316c779f27c7f2c0..ba43b3067fa3edcfaa14869add634c307b7e9a78 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