Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f2882d3 authored by Rickard Strandqvist's avatar Rickard Strandqvist Committed by Greg Kroah-Hartman
Browse files

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: default avatarRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eb967126
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -401,9 +401,9 @@ int libcfs_debug_init(unsigned long bufsize)
	}
	}


	if (libcfs_debug_file_path != NULL) {
	if (libcfs_debug_file_path != NULL) {
		memset(libcfs_debug_file_path_arr, 0, PATH_MAX);
		strncpy(libcfs_debug_file_path_arr,
		strncpy(libcfs_debug_file_path_arr,
			libcfs_debug_file_path, PATH_MAX-1);
			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
	/* If libcfs_debug_mb is set to an invalid value or uninitialized