mirror of
https://github.com/cc65/cc65.git
synced 2025-02-04 13:32:54 +00:00
Fixed another bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@3329 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
5b851fb621
commit
0ce95ffe6a
@ -211,6 +211,15 @@ static void FormatInt (PrintfCtrl* P, unsigned long Val)
|
||||
/* Convert the value into a (reversed string). */
|
||||
ToStr (P, Val);
|
||||
|
||||
/* The default precision for all integer conversions is one. This means
|
||||
* that the fPrec flag is always set and does not need to be checked
|
||||
* later on.
|
||||
*/
|
||||
if ((P->Flags & fPrec) == 0) {
|
||||
P->Flags |= fPrec;
|
||||
P->Prec = 1;
|
||||
}
|
||||
|
||||
/* Determine the leaders for alternative forms */
|
||||
if ((P->Flags & fHash) != 0) {
|
||||
if (P->Base == 16) {
|
||||
@ -219,14 +228,14 @@ static void FormatInt (PrintfCtrl* P, unsigned long Val)
|
||||
Lead[LeadCount++] = (P->Flags & fUpcase)? 'X' : 'x';
|
||||
} else if (P->Base == 8) {
|
||||
/* Alternative form for 'o': always add a leading zero. */
|
||||
if ((P->Flags & fPrec) == 0 || P->Prec <= P->ArgLen) {
|
||||
if (P->Prec <= P->ArgLen) {
|
||||
Lead[LeadCount++] = '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine the amount of precision padding needed */
|
||||
if ((P->Flags & fPrec) != 0 && P->ArgLen < P->Prec) {
|
||||
if (P->ArgLen < P->Prec) {
|
||||
PrecPadding = P->Prec - P->ArgLen;
|
||||
} else {
|
||||
PrecPadding = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user