summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-08-13 14:44:44 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-08-21 07:54:07 +1000
commit4912b4adb666dad96b832ab2d7caaae49808723e (patch)
tree433f431acc83cb498d7d9f5ffd1324ef119e6809 /os
parent7f8c39c8b5ef89153ecd84d16331e96d8feb18ef (diff)
os: add support for %d and %i to pnprintf
The mouse driver uses %i in some debug messages Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'os')
-rw-r--r--os/log.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/os/log.c b/os/log.c
index 25da9f63a..4348739d4 100644
--- a/os/log.c
+++ b/os/log.c
@@ -290,6 +290,7 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
int p_len;
int i;
uint64_t ui;
+ int64_t si;
for (; f_idx < f_len && s_idx < size - 1; f_idx++) {
if (f[f_idx] != '%') {
@@ -314,6 +315,15 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
for (i = 0; i < p_len && s_idx < size - 1; i++)
string[s_idx++] = number[i];
break;
+ case 'i':
+ case 'd':
+ si = va_arg(args, int);
+ FormatInt64(si, number);
+ p_len = strlen_sigsafe(number);
+
+ for (i = 0; i < p_len && s_idx < size - 1; i++)
+ string[s_idx++] = number[i];
+ break;
case 'p':
string[s_idx++] = '0';