From 947a10b1552cd512c16d562384253a6f52aa5178 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Mon, 1 Sep 2014 13:19:43 +0000 Subject: ArmPlatformPkg/Bds: Corrected a bug in IsPrintableString() Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ronald Cron Reviewed-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16010 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/BdsHelper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ArmPlatformPkg/Bds/BdsHelper.c') diff --git a/ArmPlatformPkg/Bds/BdsHelper.c b/ArmPlatformPkg/Bds/BdsHelper.c index 27180d9..b3003e9 100644 --- a/ArmPlatformPkg/Bds/BdsHelper.c +++ b/ArmPlatformPkg/Bds/BdsHelper.c @@ -404,7 +404,9 @@ IsUnicodeString ( * Some limitations: * - it only supports unicode string that use ASCII character (< 0x100) * - single character ASCII strings are interpreted as Unicode string - * - string cannot be longer than 2 x BOOT_DEVICE_OPTION_MAX (600 bytes) + * - string cannot be longer than BOOT_DEVICE_OPTION_MAX characters and + * thus (BOOT_DEVICE_OPTION_MAX*2) bytes for an Unicode string and + * BOOT_DEVICE_OPTION_MAX bytes for an ASCII string. * * @param String Buffer that might contain a Unicode or Ascii string * @param IsUnicode If not NULL this boolean value returns if the string is an @@ -446,7 +448,7 @@ IsPrintableString ( } IsPrintable = FALSE; - for (Index = 0; Index < BOOT_DEVICE_OPTION_MAX * 2; Index++) { + for (Index = 0; Index < BOOT_DEVICE_OPTION_MAX; Index++) { if (UnicodeDetected) { Character = ((CHAR16*)String)[Index]; } else { -- cgit v1.1