]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/FatPei/FatLiteLib.c
1. Expand and add null terminate to end of string like function comments said in...
[mirror_edk2.git] / FatPkg / FatPei / FatLiteLib.c
index b5191b6706f01dfe21dc5762e687e36bee6033c4..06f031defe6924ff6870747699b258c8a6505a5f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   General purpose supporting routines for FAT recovery PEIM\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 \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
@@ -317,15 +317,16 @@ EngFatToStr (
   // No DBCS issues, just expand and add null terminate to end of string\r
   //\r
   while (*Fat != 0 && FatSize != 0) {\r
+    if (*Fat == ' ') {\r
+      break;\r
+    }\r
     *String = *Fat;\r
     String += 1;\r
     Fat += 1;\r
     FatSize -= 1;\r
-    if (*Fat == ' ') {\r
-      *String = 0;\r
-      return ;\r
-    }\r
   }\r
+\r
+  *String = 0;\r
 }\r
 \r
 \r