)\r
{\r
CHAR8 *Buf;\r
+ UINTN BufSize;\r
\r
/* +1 for '/' and +1 for '\0' */\r
- Buf = AllocateZeroPool (\r
- AsciiStrLen (DirectoryPath) + AsciiStrLen (Node) + 2);\r
- AsciiStrCat (Buf, DirectoryPath);\r
- if (Node[0] != '\0') {\r
- AsciiStrCat (Buf, "/");\r
- AsciiStrCat (Buf, Node);\r
+ BufSize = AsciiStrLen (DirectoryPath) + AsciiStrLen (Node) + 2;\r
+ Buf = AllocatePool (BufSize);\r
+ ASSERT (Buf != NULL);\r
+\r
+ if (Node[0] == '\0') {\r
+ AsciiSPrint (Buf, BufSize, "%a", DirectoryPath);\r
+ } else {\r
+ AsciiSPrint (Buf, BufSize, "%a/%a", DirectoryPath, Node);\r
}\r
\r
return Buf;\r
{ XENSTORE_STATUS_EISCONN, "EISCONN" },\r
{ XENSTORE_STATUS_E2BIG, "E2BIG" }\r
};\r
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))\r
\r
STATIC\r
XENSTORE_STATUS\r
\r
/* Initialize the shared memory rings to talk to xenstored */\r
Status = XenStoreInitComms (&xs);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
\r
return Status;\r
}\r
}\r
\r
XENSTORE_STATUS\r
+EFIAPI\r
XenStoreVSPrint (\r
IN CONST XENSTORE_TRANSACTION *Transaction,\r
IN CONST CHAR8 *DirectoryPath,\r