summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-01-25 03:10:15 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-01-25 03:10:15 +0000
commit0c0e0a041daab3600ed326a712437cc3a14afd33 (patch)
tree04823a015c2ba9b9cc74c40ae27d4053abd51e6e /MdePkg
parentd02d144f4b09614beb59e58f459ffd3e7c5a3855 (diff)
downloadedk2-platforms-0c0e0a041daab3600ed326a712437cc3a14afd33.tar.xz
Fix a bug in print library "%a" should not print anything if the var argument points to a null string.
The default precision for string should be set to 0 according to MdeLib spec. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4634 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/BasePrintLib/PrintLib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c
index 145ca3494a..548ec5490f 100644
--- a/MdePkg/Library/BasePrintLib/PrintLib.c
+++ b/MdePkg/Library/BasePrintLib/PrintLib.c
@@ -355,6 +355,12 @@ BasePrintLibVSPrint (
Flags &= (~ARGUMENT_UNICODE);
ArgumentString = "<null string>";
}
+ //
+ // Set the default precision for string to be zero if not specified.
+ //
+ if ((Flags & PRECISION) == 0) {
+ Precision = 0;
+ }
break;
case 'c':