+Index: shellenv/batch.c\r
+===================================================================\r
+--- shellenv/batch.c (revision 30)\r
++++ shellenv/batch.c (working copy)\r
+@@ -2074,17 +2074,17 @@\r
+ --*/
+ {
+ //
+- // UNICODE byte-order-mark is two bytes
++ // UNICODE byte-order-mark is 16 bits
+ //
+- CHAR8 Buffer8[2];
++ UINT16 Uint16;
+ UINTN BufSize;
+ EFI_STATUS Status;
+
+ //
+ // Read the first two bytes to check for byte order mark
+ //
+- BufSize = sizeof (Buffer8);
+- Status = File->Read (File, &BufSize, Buffer8);
++ BufSize = sizeof (Uint16);
++ Status = File->Read (File, &BufSize, &Uint16);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+@@ -2098,9 +2098,8 @@\r
+ // otherwise assume it is ASCII. UNICODE byte order mark on
+ // IA little endian is first byte 0xff and second byte 0xfe
+ //
+- if ((Buffer8[0] | (Buffer8[1] << 8)) == EFI_UNICODE_BYTE_ORDER_MARK) {
++ if ((BufSize == 2) && (Uint16 == EFI_UNICODE_BYTE_ORDER_MARK)) {
+ *IsAscii = FALSE;
+-
+ } else {
+ *IsAscii = TRUE;
+ }