//\r
// TmpStr size is 64, StrPercent is reserved to 16.\r
//\r
- StrCatS (StrPercent, sizeof (StrPercent) / sizeof (CHAR16), TmpStr);\r
+ StrnCatS (\r
+ StrPercent,\r
+ sizeof (StrPercent) / sizeof (CHAR16), \r
+ TmpStr,\r
+ sizeof (StrPercent) / sizeof (CHAR16) - StrLen (StrPercent) - 1\r
+ );\r
PrintXY (10, 10, NULL, NULL, StrPercent);\r
FreePool (TmpStr);\r
}\r
\r
TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED));\r
if (TmpStr != NULL) {\r
- StrCatS (StrTotalMemory, StrTotalMemorySize / sizeof (CHAR16), TmpStr);\r
+ StrnCatS (\r
+ StrTotalMemory,\r
+ StrTotalMemorySize / sizeof (CHAR16),\r
+ TmpStr,\r
+ StrTotalMemorySize / sizeof (CHAR16) - StrLen (StrTotalMemory) - 1\r
+ );\r
FreePool (TmpStr);\r
}\r
\r