]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/BaseFileHandleLib/BaseFileHandleLib.c
fix operator order.
[mirror_edk2.git] / ShellPkg / Library / BaseFileHandleLib / BaseFileHandleLib.c
index 9136b9c20080b5dca78088beb64fb5ac1f519624..3200385ee58b0e63f23105b66ff8e0e1f0c12abb 100644 (file)
@@ -668,6 +668,7 @@ StrnCatGrowLeft (
   ){\r
   UINTN DestinationStartSize;\r
   UINTN NewSize;\r
+  UINTN CopySize;\r
 \r
   //\r
   // ASSERTs\r
@@ -714,7 +715,8 @@ StrnCatGrowLeft (
     *Destination = AllocateZeroPool((Count+1)*sizeof(CHAR16));\r
   }\r
 \r
-  *Destination = CopyMem(*Destination+StrLen(Source), *Destination, StrSize(*Destination));\r
+  CopySize = StrSize(*Destination);\r
+  *Destination = CopyMem((*Destination)+StrLen(Source), *Destination, CopySize);\r
   *Destination = CopyMem(*Destination, Source, StrLen(Source));\r
   return (*Destination);\r
 }\r
@@ -798,7 +800,7 @@ FileHandleGetFileName (
   }\r
 \r
   if (EFI_ERROR(Status) && *FullFileName != NULL) {\r
-    FreePool(FullFileName);\r
+    FreePool(*FullFileName);\r
   }\r
 \r
   return (Status);\r
@@ -808,8 +810,8 @@ FileHandleGetFileName (
   Function to read a single line (up to but not including the \n) from a file.\r
 \r
   @param[in]      Handle        FileHandle to read from\r
-  @param[in,out] Buffer        pointer to buffer to read into\r
-  @param[in,out] Size          pointer to number of bytes in buffer\r
+  @param[in,out]  Buffer        pointer to buffer to read into\r
+  @param[in,out]  Size          pointer to number of bytes in buffer\r
   @param[in[      Truncate      if TRUE then allows for truncation of the line to fit.\r
                                 if FALSE will reset the position to the begining of the \r
                                 line if the buffer is not large enough.\r