From e75390f02971bcd4d67a9696508050bee4936a01 Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Tue, 30 Jun 2015 03:18:31 +0000 Subject: ShellPkg: Use safe string functions to refine code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin Reviewed-by: Jaben Carsey Reviewed-by: Star Zeng git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17730 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c') diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c index b91ae360ca..dd878c4cb7 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c @@ -3229,13 +3229,13 @@ QueryTable ( // if ((High > Low && Key >= Low && Key <= High) || (Table[Index].Key == Key)) { - StrnCpy (Info, Table[Index].Info, InfoLen-1); - StrnCat (Info, L"\n", InfoLen - 1 - StrLen(Info)); + StrCpyS (Info, InfoLen, Table[Index].Info); + StrCatS (Info, InfoLen, L"\n"); return Key; } } - StrnCpy (Info, L"Undefined Value\n", InfoLen - 1); + StrCpyS (Info, InfoLen, L"Undefined Value\n"); return QUERY_TABLE_UNFOUND; } -- cgit v1.2.3