mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
staging: unisys: include: uisutils.h: Cleaning up missing null-terminate in conjunction with strncpy
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
645b031452
commit
4c86db6aac
1 changed files with 4 additions and 4 deletions
|
|
@ -307,20 +307,20 @@ Issue_VMCALL_CHANNEL_MISMATCH(const char *ChannelName,
|
|||
U64 physaddr;
|
||||
char *last_slash = NULL;
|
||||
|
||||
strncpy(params.ChannelName, ChannelName,
|
||||
strlcpy(params.ChannelName, ChannelName,
|
||||
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ChannelName));
|
||||
strncpy(params.ItemName, ItemName,
|
||||
strlcpy(params.ItemName, ItemName,
|
||||
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ItemName));
|
||||
params.SourceLineNumber = SourceLineNumber;
|
||||
|
||||
last_slash = strrchr(path_n_fn, '/');
|
||||
if (last_slash != NULL) {
|
||||
last_slash++;
|
||||
strncpy(params.SourceFileName, last_slash,
|
||||
strlcpy(params.SourceFileName, last_slash,
|
||||
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS,
|
||||
SourceFileName));
|
||||
} else
|
||||
strncpy(params.SourceFileName,
|
||||
strlcpy(params.SourceFileName,
|
||||
"Cannot determine source filename",
|
||||
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS,
|
||||
SourceFileName));
|
||||
|
|
|
|||
Loading…
Reference in a new issue