Fixed another printk bug.
This commit is contained in:
parent
1ef6bb95b3
commit
c471bb6608
@ -165,8 +165,8 @@ int printk(struct vgastate *term, const char *fmt, ...)
|
|||||||
mode |= 0x06;
|
mode |= 0x06;
|
||||||
length = 5;
|
length = 5;
|
||||||
break;
|
break;
|
||||||
case 'd':
|
|
||||||
// Print a signed integer
|
// Print a signed integer
|
||||||
|
case 'd':
|
||||||
case 'i': {
|
case 'i': {
|
||||||
intmax_t num;
|
intmax_t num;
|
||||||
uintmax_t unum;
|
uintmax_t unum;
|
||||||
@ -208,7 +208,7 @@ int printk(struct vgastate *term, const char *fmt, ...)
|
|||||||
flen += (precision - len);
|
flen += (precision - len);
|
||||||
if (num < 0)
|
if (num < 0)
|
||||||
flen++;
|
flen++;
|
||||||
if (num >= 0 && ((mode >> 3) % 2 == 1 || (mode >> 4) % 2 == 1))
|
if (num >= 0 && (mode >> 3) + (mode >> 4) > 0)
|
||||||
flen++;
|
flen++;
|
||||||
|
|
||||||
// If specified, print preceding space padding
|
// If specified, print preceding space padding
|
||||||
@ -368,7 +368,7 @@ int printk(struct vgastate *term, const char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the length of the printed number
|
// Get the length of the printed number
|
||||||
unsigned int len = numLen(num, 10);
|
unsigned int len = numLen(num, 16);
|
||||||
|
|
||||||
// Get the length of the printed number with formatting
|
// Get the length of the printed number with formatting
|
||||||
unsigned int flen = len;
|
unsigned int flen = len;
|
||||||
@ -464,7 +464,7 @@ int printk(struct vgastate *term, const char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the length of the printed number
|
// Get the length of the printed number
|
||||||
unsigned int len = numLen(num, 10);
|
unsigned int len = numLen(num, 8);
|
||||||
|
|
||||||
// Get the length of the printed number with formatting
|
// Get the length of the printed number with formatting
|
||||||
unsigned int flen = len;
|
unsigned int flen = len;
|
||||||
|
Loading…
Reference in New Issue
Block a user