From 37055b928650f6c09902e1677af79fca1ab1807f Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 14 Dec 2019 11:46:09 +0100 Subject: [PATCH] stdio: Add support for %p format string (pointer address) We actually llready had plrenty of code using %p, despite our stdio not implementing it ;) Change-Id: Iecf6c849ce5ef72a8fed9b19a18e215c61c3d09f --- firmware/libcommon/source/stdio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/libcommon/source/stdio.c b/firmware/libcommon/source/stdio.c index a8612d18..1002c2df 100644 --- a/firmware/libcommon/source/stdio.c +++ b/firmware/libcommon/source/stdio.c @@ -358,6 +358,7 @@ signed int vsnprintf(char *pStr, size_t length, const char *pFormat, va_list ap) case 'i': num = PutSignedInt(pStr, fill, width, va_arg(ap, signed int)); break; case 'u': num = PutUnsignedInt(pStr, fill, width, va_arg(ap, unsigned int)); break; case 'x': num = PutHexa(pStr, fill, width, 0, va_arg(ap, unsigned int)); break; + case 'p': num = PutHexa(pStr, fill, width, 0, va_arg(ap, unsigned long)); break; case 'X': num = PutHexa(pStr, fill, width, 1, va_arg(ap, unsigned int)); break; case 's': num = PutString(pStr, va_arg(ap, char *)); break; case 'c': num = PutChar(pStr, va_arg(ap, unsigned int)); break;