]> 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 023210e8e0f0dc484a24b830d9f35e2d130d7a72..3200385ee58b0e63f23105b66ff8e0e1f0c12abb 100644 (file)
@@ -648,8 +648,8 @@ FileHandleGetSize (
   if Destination's current length (including NULL terminator) is already more then \r
   CurrentSize, then ASSERT()\r
 \r
-  @param[in][out] Destination   The String to append onto\r
-  @param[in][out] CurrentSize   on call the number of bytes in Destination.  On \r
+  @param[in,out] Destination   The String to append onto\r
+  @param[in,out] CurrentSize   on call the number of bytes in Destination.  On \r
                                 return possibly the new size (still in bytes).  if NULL\r
                                 then allocate whatever is needed.\r
   @param[in]      Source        The String to append from\r
@@ -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