Fix VS 2005 compatibility issue
[mirror_edk2.git] / EdkNt32Pkg / Dxe / WinNtThunk / Bus / BlockIo / WinNtBlockIo.c
index 2f650927475fed439f82550b78609f2e4d6cef0e..014f8a6c069eb64ea4749702f9946ee78e9e9135 100644 (file)
@@ -204,14 +204,15 @@ Returns:
   if (DiskType == EfiWinNtVirtualDisks) {\r
     WinNtIo->WinNtThunk->SPrintf (\r
                           Buffer,\r
+                          sizeof (Buffer),\r
                           L"Diskfile%d",\r
                           WinNtIo->InstanceNumber\r
                           );\r
   } else {\r
     if (*Str >= 'A' && *Str <= 'Z' || *Str >= 'a' && *Str <= 'z') {\r
-      WinNtIo->WinNtThunk->SPrintf (Buffer, L"\\\\.\\%c:", *Str);\r
+      WinNtIo->WinNtThunk->SPrintf (Buffer, sizeof (Buffer), L"\\\\.\\%c:", *Str);\r
     } else {\r
-      WinNtIo->WinNtThunk->SPrintf (Buffer, L"\\\\.\\PHYSICALDRIVE%c", *Str);\r
+      WinNtIo->WinNtThunk->SPrintf (Buffer, sizeof (Buffer), L"\\\\.\\PHYSICALDRIVE%c", *Str);\r
     }\r
 \r
     Str++;\r