Printf %x with fixed length

This commit is contained in:
Quinten Kock 2020-12-07 21:30:21 +01:00
parent 8c033a462d
commit ac10ded5e5
1 changed files with 5 additions and 1 deletions

View File

@ -32,8 +32,12 @@ static void printhex(size_t num) {
num /= 16;
}
i++;
puts("0x");
for(int j = i; j >= 0; j--) {
putchar('0');
}
i++;
puts(&buf[i]);
}