diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-06-28 09:41:50 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-06-28 09:41:50 +0000 |
commit | ab1096fdf6d3e2d6acb67e8bdf884af8bbc2d8fe (patch) | |
tree | c49c5887c602a0821ca3dc8f571ba72bdc8631fc /MdePkg/Library/BasePrintLib/PrintLib.c | |
parent | eb6f7758565616762bf1b7143f5f336abadb6d16 (diff) | |
download | edk2-platforms-ab1096fdf6d3e2d6acb67e8bdf884af8bbc2d8fe.tar.xz |
1.BaseMemoryLibMmx: Add X64 Cpu Arch support.
2.BasePrintLib: Fix some minor bugs
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@651 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BasePrintLib/PrintLib.c')
-rw-r--r-- | MdePkg/Library/BasePrintLib/PrintLib.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c index bbafeeaec5..1484d891b6 100644 --- a/MdePkg/Library/BasePrintLib/PrintLib.c +++ b/MdePkg/Library/BasePrintLib/PrintLib.c @@ -227,6 +227,17 @@ BasePrintLibVSPrint ( Precision = Count;
}
break;
+
+ case '\0':
+ //
+ // Make no output if Format string terminates unexpectedly when
+ // looking up for flag, width, precision and type.
+ //
+ Format -= BytesPerFormatCharacter;
+ Precision = 0;
+ //
+ // break skiped on purpose.
+ //
default:
Done = TRUE;
break;
@@ -299,19 +310,26 @@ BasePrintLibVSPrint ( Count = 0;
}
ArgumentString = (CHAR8 *)ValueBuffer + Count;
- Digits = 3 - (Count % 3);
+
+ Digits = Count % 3;
+ if (Digits != 0) {
+ Digits = 3 - Digits;
+ }
if (Comma && Count != 0) {
Count += ((Count - 1) / 3);
}
if (Prefix != 0) {
Count++;
+ Precision++;
}
Flags |= ARGUMENT_REVERSED;
ZeroPad = TRUE;
if ((Flags & PREFIX_ZERO) != 0) {
- if ((Flags & PAD_TO_WIDTH) != 0) {
- if ((Flags & PRECISION) == 0) {
- Precision = Width;
+ if ((Flags & LEFT_JUSTIFY) == 0) {
+ if ((Flags & PAD_TO_WIDTH) != 0) {
+ if ((Flags & PRECISION) == 0) {
+ Precision = Width;
+ }
}
}
}
|