Index: kernel/generic/src/printf/printf_core.c
===================================================================
--- kernel/generic/src/printf/printf_core.c	(revision a721f6a2c63802500636ecfd5e60b628b5bdce9c)
+++ kernel/generic/src/printf/printf_core.c	(revision 25a76ab8c8fc91bff44734720fc598b1f6bf55d3)
@@ -261,10 +261,10 @@
 	if (str == NULL)
 		return printf_putstr(nullstr, ps);
-
+	
 	/* Print leading spaces. */
 	size_t strw = str_length(str);
 	if (precision == 0)
 		precision = strw;
-
+	
 	/* Left padding */
 	size_t counter = 0;
@@ -276,5 +276,5 @@
 		}
 	}
-
+	
 	/* Part of @a str fitting into the alloted space. */
 	int retval;
@@ -391,5 +391,5 @@
 	 */
 	if (flags & __PRINTF_FLAG_PREFIX) {
-		switch(base) {
+		switch (base) {
 		case 2:
 			/* Binary formating is not standard, but usefull */
@@ -455,5 +455,5 @@
 	/* Print prefix */
 	if (flags & __PRINTF_FLAG_PREFIX) {
-		switch(base) {
+		switch (base) {
 		case 2:
 			/* Binary formating is not standard, but usefull */
@@ -570,6 +570,7 @@
  *
  *  - P, p Print value of a pointer. Void * value is expected and it is
- *         printed in hexadecimal notation with prefix (as with \%#X / \%#x
- *         for 32-bit or \%#X / \%#x for 64-bit long pointers).
+ *         printed in hexadecimal notation with prefix (as with
+ *         \%#0.8X / \%#0.8x for 32-bit or \%#0.16lX / \%#0.16lx for 64-bit
+ *         long pointers).
  *
  *  - b Print value as unsigned binary number. Prefix is not printed by
@@ -784,4 +785,5 @@
 			case 'p':
 				flags |= __PRINTF_FLAG_PREFIX;
+				flags |= __PRINTF_FLAG_ZEROPADDED;
 				base = 16;
 				qualifier = PrintfQualifierPointer;
@@ -846,5 +848,6 @@
 			case PrintfQualifierPointer:
 				size = sizeof(void *);
-				number = (uint64_t) (unsigned long) va_arg(ap, void *);
+				precision = size << 1;
+				number = (uint64_t) (uintptr_t) va_arg(ap, void *);
 				break;
 			default:
