]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/EnhancedFatDxe/FileName.c
Vlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code
[mirror_edk2.git] / FatPkg / EnhancedFatDxe / FileName.c
index 8ad298a2d7136b8f8e793c16a1dab69cdc180f6e..551cda53b9a4e5b968d4d5f364a61066b7471828 100644 (file)
@@ -1,7 +1,7 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials are licensed and made available\r
+Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available\r
 under the terms and conditions of the BSD License which accompanies this\r
 distribution. The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -299,10 +299,9 @@ Returns:
 \r
 --*/\r
 {\r
-  CHAR16  Buffer[FAT_MAIN_NAME_LEN + 1];\r
+  CHAR16  Buffer[FAT_MAIN_NAME_LEN + 1 + FAT_EXTEND_NAME_LEN + 1];\r
   UINT8   OutCaseFlag;\r
 \r
-  ASSERT (StrSize (Str) <= sizeof (Buffer));\r
   //\r
   // Assume the case of input string is mixed\r
   //\r
@@ -311,7 +310,7 @@ Returns:
   // Lower case a copy of the string, if it matches the\r
   // original then the string is lower case\r
   //\r
-  StrCpy (Buffer, Str);\r
+  StrCpyS (Buffer, sizeof (Buffer) / sizeof (Buffer[0]), Str);\r
   FatStrLwr (Buffer);\r
   if (StrCmp (Str, Buffer) == 0) {\r
     OutCaseFlag = InCaseFlag;\r
@@ -320,7 +319,7 @@ Returns:
   // Upper case a copy of the string, if it matches the\r
   // original then the string is upper case\r
   //\r
-  StrCpy (Buffer, Str);\r
+  StrCpyS (Buffer, sizeof (Buffer) / sizeof (Buffer[0]), Str);\r
   FatStrUpr (Buffer);\r
   if (StrCmp (Str, Buffer) == 0) {\r
     OutCaseFlag = 0;\r
@@ -392,8 +391,9 @@ Returns:
 \r
 VOID\r
 FatGetFileNameViaCaseFlag (\r
-  IN  FAT_DIRENT    *DirEnt,\r
-  OUT CHAR16        *FileString\r
+  IN     FAT_DIRENT   *DirEnt,\r
+  IN OUT CHAR16       *FileString,\r
+  IN     UINTN        FileStringMax\r
   )\r
 /*++\r
 \r
@@ -425,7 +425,7 @@ Returns:
   FatNameToStr (File8Dot3Name + FAT_MAIN_NAME_LEN, FAT_EXTEND_NAME_LEN, CaseFlag & FAT_CASE_EXT_LOWER, &TempExt[1]);\r
   if (TempExt[1] != 0) {\r
     TempExt[0] = L'.';\r
-    StrCat (FileString, TempExt);\r
+    StrCatS (FileString, FileStringMax, TempExt);\r
   }\r
 }\r
 \r