MdePkg/BasePrintLib: Fix incomplete print output
authorWang, Jian J <jian.j.wang@intel.com>
Tue, 2 Jan 2018 08:20:20 +0000 (16:20 +0800)
committerLiming Gao <liming.gao@intel.com>
Tue, 2 Jan 2018 08:31:19 +0000 (16:31 +0800)
commit701e8cc29a283d6d598695592ca2469cdacddf64
tree03b0db465853639ed1bd76c57e303f31398b9f81
parentcd16355bbf3267f1ad7f678e91dc60cf31f3cb29
MdePkg/BasePrintLib: Fix incomplete print output

This is caused by previous patch which tried to fix string over-read,
which breaks UEFI menu rendering: the following

/------------------------------------------------------------------------------\
|                               Device Manager                                 |
\------------------------------------------------------------------------------/

is rendered as

/\
|                               Device Manager                                 |
\/.0                                                 2.00 GHz

(the spurious digits are SMBIOS data from the home screen)

The problem appears to be that the CHAR16 value of BOXDRAW_HORIZONTAL
equals 0x2500, which means that testing ArgumentString[] != '\0'
(which tests the low byte only) will yield FALSE and terminate the
loop prematurely.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/BasePrintLib/PrintLibInternal.c