]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/TianoTools/StrGather/StrGather.c
Add Mde String and PrintLibs. Port StrGather to the Mde Unicode implementation. Compi...
[mirror_edk2.git] / Tools / Source / TianoTools / StrGather / StrGather.c
index 3ad77247ae4c8455c5031b10f009e877ba687cca..1fc204d14796964f6cc7aa6c88c1b9879a17256f 100644 (file)
@@ -1248,21 +1248,21 @@ ProcessTokenLanguage (
       // quoted strings, and concatenate them until we get a failure\r
       // back from the string parser.\r
       //\r
-      Len = wcslen (String) + 1;\r
+      Len = StrLen (String) + 1;\r
       ParserSetPosition (SourceFile->FileName, SourceFile->LineNum);\r
       do {\r
         SkipWhiteSpace (SourceFile);\r
         SecondString = GetQuotedString (SourceFile, TRUE);\r
         if (SecondString != NULL) {\r
-          Len += wcslen (SecondString);\r
+          Len += StrLen (SecondString);\r
           TempString = (WCHAR *) malloc (Len * sizeof (WCHAR));\r
           if (TempString == NULL) {\r
             Error (NULL, 0, 0, "application error", "failed to allocate memory");\r
             return ;\r
           }\r
 \r
-          wcscpy (TempString, String);\r
-          wcscat (TempString, SecondString);\r
+          StrCpy (TempString, String);\r
+          StrCat (TempString, SecondString);\r
           free (String);\r
           free (SecondString);\r
           String = TempString;\r
@@ -1973,14 +1973,14 @@ AddCommandLineLanguage (
     // long. If we find a comma, then we're done with this group, so\r
     // break out.\r
     //\r
-    swprintf (WNewList->Str, L"%S", Language);\r
+    UnicodeSPrint (WNewList->Str, (strlen (Language) + 1) * sizeof (WCHAR), L"%a", Language);\r
     From = To = WNewList->Str;\r
     while (*From) {\r
       if (*From == L',') {\r
         break;\r
       }\r
 \r
-      if ((wcslen (From) < LANGUAGE_IDENTIFIER_NAME_LEN) ||\r
+      if ((StrLen (From) < LANGUAGE_IDENTIFIER_NAME_LEN) ||\r
             (\r
               (From[LANGUAGE_IDENTIFIER_NAME_LEN] != 0) &&\r
               (From[LANGUAGE_IDENTIFIER_NAME_LEN] != UNICODE_PLUS_SIGN) &&\r
@@ -1993,7 +1993,7 @@ AddCommandLineLanguage (
         return STATUS_ERROR;\r
       }\r
 \r
-      wcsncpy (To, From, LANGUAGE_IDENTIFIER_NAME_LEN);\r
+      StrnCpy (To, From, LANGUAGE_IDENTIFIER_NAME_LEN);\r
       To += LANGUAGE_IDENTIFIER_NAME_LEN;\r
       From += LANGUAGE_IDENTIFIER_NAME_LEN;\r
       if (*From == L'+') {\r
@@ -2114,8 +2114,8 @@ ParseIndirectionFiles (
                 goto Done;\r
               }\r
 \r
-              swprintf (NewList->Str1, L"%S", StringName);\r
-              swprintf (NewList->Str2, L"%S", ScopeName);\r
+              UnicodeSPrint (NewList->Str1, strlen (StringName) + 1, L"%a", StringName);\r
+              UnicodeSPrint (NewList->Str2, strlen (ScopeName) + 1, L"%a", ScopeName);\r
               if (mGlobals.IndirectionList == NULL) {\r
                 mGlobals.IndirectionList = NewList;\r
               } else {\r